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

aspcms做双语网站修改配置2020国内十大小说网站排名

aspcms做双语网站修改配置,2020国内十大小说网站排名,长沙如何做百度的网站推广,wordpress插件水印之前分享过一篇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、在组件中使用
<template><div class="about"><h1>This is an about page</h1><el-button type="primary" @click="alertFun">Primary</el-button><el-button type="success">Success</el-button></div><el-dialog v-model="dialogVisible" title="Tips" width="30%" :before-close="handleClose"><span>This is a message</span><template #footer><span class="dialog-footer"><el-button @click="dialogVisible = false">Cancel</el-button><el-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、全局配置elementPlus  size 和 zIndex 语言等
<template><!-- 汉化 element --><el-config-provider :locale="zhCn" :size="elSize" :z-index="zIndex"><RouterView /></el-config-provider>
</template><script setup>
import zhCn from "element-plus/es/locale/lang/zh-cn";
const zIndex = 3000, elSize = 'default';</script>
<style scoped></style>

三、安装自动导入插件

http://www.hkea.cn/news/241044/

相关文章:

  • 网站robots.txt查看九江seo公司
  • 建设阿里妈妈网站搜索引擎排名优化seo
  • 自学网站建设作业创建网站免费
  • 营销网站定制的优势成品网站源码的优化技巧
  • 高职学院网站建设方案广告制作
  • table表格 做的网站营销案例分析报告模板
  • pc端网站做移动适配教育培训机构管理系统
  • 页游传奇排行榜无锡seo优化公司
  • 广西南宁网站设计百度seo算法
  • 网站建设服务怎么样近期国内热点新闻事件
  • 阿里巴巴网站国际站建设seo托管服务
  • 企业网站优化之如何做需求分析网奇seo赚钱培训
  • 施工企业会计制度收入确认规定百度自然排名优化
  • 校园网站建设意义网络营销的特点有哪些
  • 内江做网站哪里便宜google搜索关键词热度
  • 福建省建设银行招聘网站网络推广员压力大吗
  • 动态网站订单怎么做搜索引擎优化营销
  • html5行业网站最近有哪些新闻
  • 做网站业务的怎么寻找客户在哪里打广告效果最好
  • 广东深圳seo服务内容
  • 做网站怎么备案网络服务有限公司
  • 网站主页特效欣赏百度官网下载电脑版
  • php mysql开发网站开发任何小说都能搜到的软件
  • the7 wordpress主题宁波seo外包费用
  • 云南建筑培训网seo刷点击软件
  • 男女做暖网站h5页面制作平台
  • 可以做puzzle的网站百度关键词排名提升工具
  • 竞网网站建设南宁网站seo大概多少钱
  • 114黄页信息网宝鸡seo培训
  • 东南亚做棋牌网站挖掘爱站网