当前位置: 首页 > news >正文

嘉兴云建站模板seo优化搜索引擎网站优化推广网络关键词优化-乐之家网络科技

嘉兴云建站模板,seo优化搜索引擎网站优化推广网络关键词优化-乐之家网络科技,茌平建设局网站,企业网站营销之前分享过一篇vue3+ts+vite构建工程化项目的文章,针对小的开发团队追求开发速度,不想使用ts想继续使用js,所以就记录一下从0搭建一个vite+vue3+js的前端项目,做记录分享。 技术栈 Vite 3 - 构建工具 Vue 3 Vue Router - 官方路由管理器 Pinia - Vue Store你也可以选择vue… 之前分享过一篇vue3+ts+vite构建工程化项目的文章,针对小的开发团队追求开发速度,不想使用ts想继续使用js,所以就记录一下从0搭建一个vite+vue3+js的前端项目,做记录分享。 技术栈 Vite 3 - 构建工具 Vue 3 Vue Router - 官方路由管理器 Pinia - Vue Store你也可以选择vuex element-plus - UI组件库 Sass- CSS 预处理器 Axios - 一个基于 promise 的网络请求库,可以用于浏览器和 node.js Vscode - 一个还挺好用的开发工具 一、项目的基础搭建 1、构建有多种方式,本次示例选择vue官方脚手架工具create-vue 构建的 (1)使用vite的方式,构建一个基础模板 # npm 6.x npm create vite@latest my-vue-app --template vue# npm 7+, extra double-dash is needed: npm create vite@latest my-vue-app -- --template vue# yarn yarn create vite my-vue-app --template vue# pnpm pnpm create vite my-vue-app --template vue (2)使用vue官方脚手架,本教程使用此方式 npm init vue@latest 二、安装UI组件库 安装css预处理器sass npm install -D sass 或 npm add -D sass 1、在项目中安装element-plus # NPM $ npm install element-plus --save# Yarn $ yarn add element-plus# pnpm $ pnpm install element-plus 2、在mian.ts中引入并配置element-plus(完整引入)element-plus连接 import { createApp } from "vue"; import { createPinia } from "pinia"; import ElementPlus from "element-plus"; import "element-plus/dist/index.css"; import App from "./App.vue"; import router from "./router";import "./assets/main.css";const app = createApp(App);app.use(createPinia()); app.use(router);app.use(ElementPlus);app.mount("#app"); 3、按需导入,自动导入(推荐,此教程使用此方法)以下摘自element 首先你需要安装unplugin-vue-components和unplugin-auto-import这两款插件 npm install -D unplugin-vue-components unplugin-auto-import 然后把下列代码插入到你的Vite或Webpack的配置文件中 Vite // vite.config.ts import { defineConfig } from 'vite' import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'export default defineConfig({// ...plugins: [// ...AutoImport({resolvers: [ElementPlusResolver()],}),Components({resolvers: [ElementPlusResolver()],}),], }) 4、在组件中使用 templatediv class="about"h1This is an about page/h1el-button type="primary" @click="alertFun"Primary/el-buttonel-button type="success"Success/el-button/divel-dialog v-model="dialogVisible" title="Tips" width="30%" :before-close="handleClose"spanThis is a message/spantemplate #footerspan class="dialog-footer"el-button @click="dialogVisible = false"Cancel/el-buttonel-button type="primary" @click="dialogVisible = false"Confirm/el-button/span/template/el-dialog /template script setup let dialogVisible = ref(false) const handleClose = () = {ElMessageBox.confirm('Are you sure to close this dialog?').then(() = {done()}).catch(() = {// catch error}) } const alertFun = () = {ElMessage({message: 'Congrats, this is a success message.',type: 'success',})dialogVisible.value = true } /script style @media (min-width: 1024px) {.about {min-height: 100vh;display: flex;align-items: center;} } /style效果: 5、全局配置elementPlussize和zIndex 语言等 template!-- 汉化 element --el-config-provider :locale="zhCn" :size="elSize" :z-index="zIndex"RouterView //el-config-provider /templatescript setup import zhCn from "element-plus/es/locale/lang/zh-cn"; const zIndex = 3000, elSize = 'default';/script style scoped/style 三、安装自动导入插件
http://www.yutouwan.com/news/168800/

相关文章:

  • 哪个网站买域名便宜单位网站建设框架
  • 网站制作里面链接怎么做什么网站专门做二手物品
  • 零食店网站构建策划报告网站301和302
  • 哪里可以在百度做网站石家庄做网站建设的公司排名
  • 兴义网站建设公司做服装要看国外哪些网站
  • seo网站三种链接全国企业信息查询网
  • ps做的网站怎样在dw里打开山东建设机械协会官方网站
  • 51网站一起做网店安庆市建设银行网站
  • 什么是网站建设需求wordpress 电子书插件
  • 网站关键字设置海口网站建设公司哪家好
  • 百度资料怎么做网站WordPress回车按钮
  • 各大免费推广网站linux wordpress路径
  • 购物网站是用什么软件做的wordpress登录的图片
  • 淘宝网站建设那么便宜做网站 php python
  • 教育类集群网站建设做化妆品注册和注册的网站吗
  • 北京西站地铁是几号线开网站建设公司赚钱吗
  • 网站设计区域台州网页设计公司
  • 做爰全过程免费的视频的网站wordpress自动生成手机端
  • 室内设计公司免费网站网站建设排名北京
  • 花都网站建设价格wordpress修改地址
  • 青岛房地产网站建设做网站笔记本
  • 计算机网络技术网站开发网站的推广方式有哪些
  • 网站建设系统服务介绍做素食的网站
  • 网站开发培训少儿建设的网站打开速度很慢
  • 国外html 网站网站建设解决方案
  • 找别人做网站要考虑哪些如何seo推广工厂店
  • 免费注册网站怎么做链接p2p视频网站建设
  • 目前做响应式网站最好的cms网站建设布为网
  • 兰州新区建设局网站地址页面设计要求
  • 成都城乡建设部网站首页上海建设执业资格注册中心网站