Giter Site home page Giter Site logo

djun / vue3-pcweb-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matrixcross/vue3-pcweb-starter

0.0 0.0 0.0 1.18 MB

Power by Vite3⚡. A simple template of vue3-ts, include vue-router、pinia、Typescript、eslint-prettier.

Home Page: https://vue3-pc-web-starter.wyatex.online/

JavaScript 7.63% TypeScript 55.21% CSS 0.66% HTML 1.57% Vue 29.84% SCSS 5.09%

vue3-pcweb-starter's Introduction

Vue 3 Starter

Author Issues License

一套集成了 Vite 3.x + Vue 3.x + TypeScript + Vue Router + Pinia + Axios + ESlint 等套件的快速开发模板。

在线预览

快速开始

下载项目

使用 git 进行克隆

git clone https://github.com/Wyatex/Vue3-starter.git

安装依赖

pnpm i

启动 dev 服务器和构建

启动 dev 服务器

pnpm dev

构建,默认打包到'./dist'

pnpm build

技术栈

icon 图标查找:icones

项目配置

目前的主要配置项:

  • src/settings/index.ts
  • .env(.development / .production)
  • vite.config.ts

图标使用

如果是静态的icon,可以使用unplugin-icons或者unocss

<!-- unplugin-icons写法 -->
<i-ph-anchor-simple-thin />
<!-- unocss写法 -->
<div class="i-ph-anchor-simple-thin" />
<button class="i-carbon-sun dark:i-carbon-moon" />

如果是在js/ts引入icon:

import IconAccessibility from '~icons/carbon/accessibility'
import IconAccountBox from '~icons/mdi/account-box'
// 可以给jsx / tsx用,项目已经安装jsx插件可以之间使用

const IconComponent = () => (
  <div>
    <IconAccessibility />
    <IconAccountBox style={{ fontSize: '2em', color: 'red' }}/>
  </div>
)

动态icon,可以根据一个字符串名字,运行时获取icon数据:

<template>
  <Icon :icon="iconName" />
</template>
<script setup>
const iconName = ref('')
// 省略.......
iconName.value = getIconName()
</script>

上面的组件都可以用unocss快速设置样式:class="w-10px h-10px text-red",icon的宽高10px,主色为红色

打包

vite3之后,生产和开发打包都统一使用esbuild,无需安装terser进行压缩,速度更快,如果生产代码需要去除console、debugger等代码,直接配置esbuild即可。

UI 组件库

本分支(master)使用的是 NaiveUI,后续会在其他分支使用其他的组件库,比如 ArcoDesign 和 Tdesign,敬请期待!

vue3-pcweb-starter's People

Contributors

wyatex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.