摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:vue2 const fn = require.context('./views', true, /.vue$/) const paths = fn.keys()// 说有views下面.vue结尾文件,路径字符串,数组形式 路由懒加载import参数不能是字符串,可以是模板字符串,半写死 vue3
阅读全文
摘要:vue2 package.json "scripts": { "serve": "vue-cli-service serve --host 0.0.0.0 --port 5173", "build": "vue-cli-service build" }, vue3 vite.config.json
阅读全文
摘要:cnpm install vue-i18n@6//在src目录下新建langs文件夹,langs下面index.js文件代码如下import Vue from 'vue' import Element from 'element-ui' import VueI18n from 'vue-i18n'
阅读全文
摘要://祖先组件 import Son from './Son' export default { components: { Son }, provide () { return { money: 1000000000 } } } 子孙组件 <template> <div> 孙子组件 <p>这个是爷爷
阅读全文
摘要:// 1 创建一个公共的vue实例(bus) import Vue from 'vue' const bus = new Vue() export default bus <!-- brother1--> <template> <div> 兄弟1组件 <p> <button @click="send
阅读全文