vue

作者:Nick

引入自定义 css js 文件

<template>
    <h1>Index</h1>
</template>

<script>
    import './../assets/js/index.js'
    export default {
        name: "Index"
    }
</script>

<style scoped>
    @import "./../assets/css/index.css";
</style>

路由懒加载

export default new Router({
    mode: 'history',
    routes: [
        {
            path: '/',
            name: 'index',
            component: resolve => require(['@/components/Index'], resolve)
        },
        {
            path: '/comment',
            name: 'comment',
            component: resolve => require(['@/components/Comment'], resolve)
        }
    ]
})

前端