全局配置css和js
配置全局css
global.css
html, body { margin: 0; } a { color: black; text-decoration: none; } ul { margin: 0; padding: 0; }
main.js
配置全局css import ‘@/assets/css/global.css‘ // import global_css from ‘@/assets/css/global.css‘ // 资源需要用变量保存,方便以后使用 // require(‘@/assets/css/global.css‘) (推荐) // let global_css = require(‘@/assets/css/global.css‘) // 资源需要用变量保存,方便以后使用
配置全局js
settings.js
export default { base_url: ‘https://127.0.0.1:8000‘ }
main.js
配置自定义js设置文件 import settings from ‘@/assets/js/settings.js‘ Vue.prototype.$settings = settings; // 在任何一个组件中的逻辑,可以通过 this.$settings访问settings.js文件的{}数据
相关推荐
NARUTOLUOLUO 2020-08-03
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18