zoukankan      html  css  js  c++  java
  • 升级vue3注意事项记录 vue3都需要升级些什么

    sass语法的使用

    控制台报错:Syntax Error: TypeError: this.getOptions is not a function
    原因:版本问题,sass-loader的版本过新,安装10.1.1版本即可解决;

    路由跳转问题

    路由不跳转:
    原因:App.vue中别忘了加上 <router-view></router-view>

    //router: index.js
    import { createRouter,createWebHashHistory} from "vue-router"'
    
    const home = ()=> import ('../pages/home')
    const colorful = ()=> import ('../pages/colorful')
    const other = ()=> import('../pages/other')
    
    const routes = [
       {
           path: '/',
           name: 'home',
           component: home
       },
       {
           path: '/colorful',
           name: 'colorful',
           component: colorful
       },
       {
           path: '/other',
           name: 'other',
           component: other
       },
    ]
    
    const router = createRouter({
       history: createWebHashHistory(),
       routes: routes
    })
    
    export default router
    
    // main.js
    import { createApp } from 'vue'
    import App from './App.vue'
    import router from './router'
    
    const app = createApp(App)
    
    app.use(router)
    app.mount('#app')
    
    你必须穷尽一生磨练技能,这就是成功的秘诀,也是让人家敬重的关键。
  • 相关阅读:
    leetcode390
    leetcode388
    leetcode373
    leetcode368
    leetcode372
    leetcode386
    基于自定义协议的服务器高并发处理之:多线程模型
    基于自定义协议的服务器高并发处理之:多进程模型
    macos下简单的socket服务器+客户端
    Windows下编译Libevent
  • 原文地址:https://www.cnblogs.com/knuzy/p/15143850.html
Copyright © 2011-2022 走看看