一、局部
1、js
export function getInfo(id) {
return request({
url: '',
method: 'get'
})
}
import {getInfo} from "@/api/user"
getInfo(1)
2、组件
import Editor from "@/views/components/Editor/index"
components: {
Editor
}
<Editor/>
3、css
<script>
import "@/assets/css/reset.css"
export default {
}
<style scoped>
@import "@/assets/css/reset.css";
</style>
二、全局
- 全局挂载的方法、组件,在所有的组件中无需引入直接使用
- 在入口文件main.js中导入、挂载
1、js
import {isEmpty} from "@/utils/validate"
Vue.prototype.isEmpty=isEmpty
this.isEmpty(val)
2、组件
import Pagination from "@/components/Pagination"
Vue.component('Pagination', Pagination)
<pagination/>
3、css
import '@/assets/styles/index.scss'