- 博客(6)
- 收藏
- 关注
原创 vue 路由发生变化修改页面title
在src/router/index.js下,设置导航守卫,注意:路由加上titleconst routes = [ { path: "/", redirect: "/home" }, { path: "/home", component: Home, name: 'Home', meta: { title: '首页' // 路由发生变化修改页面title } }, { path: "/productASP",
2021-10-13 15:05:13 251
原创 vue cli3.0使用Element-ui
npm install element-plus --save在man.js中引入import ElementPlus from 'element-plus'import 'element-plus/dist/index.css'createApp(App).use(store).use(router).use(ElementPlus).mount('#app')注意:原来的vue cli2.0使用的是element-ui,vue cli3.0使用的是最新版的element-plus..
2021-10-13 10:05:36 185
原创 vue cli配置代理服务,解决跨域问题
创建根目录vue.config.jsmodule.exports = { devServer: { open: true, host: 'localhost', port: 8081, https: false, //以上的ip和端口是我们本机的;下面为需要跨域的 proxy: { //配置跨域 '/api': { target: 'http://localhost:9000', //这里后台的地址模拟的;应该填写你们真实的后
2021-10-13 09:39:43 97
原创 vue cli3.0打包后静态页面打不开
项目根目录下创建vue.config.jsmodule.exports = { publicPath: './', //把路径'/'变为'./',否则打包后打开静态页面报错}修改src/router/index.jsimport { createRouter, createWebHashHistory //变为hash模式} from 'vue-router'const routerHistory = createWebHashHistory() //变为hash模.
2021-10-13 09:31:29 507
原创 vue cli3.0使用百度地图
申请百度地图ak在src目录下创建一个js文件,如:map.js,代码如下export function MP(ak) { return new Promise(function (resolve, reject) { window.init = function () { resolve(BMap) } var script = document.createElement("script"); script.type = "text/javasc.
2021-10-12 18:54:38 551
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人