zoukankan      html  css  js  c++  java
  • nuxt 2.0采坑计之 (引入静态文件css)

    nuxt 2.0采坑计之静态文件css

    外部引入css

    全局引用方法为   (在nuxt.config.js配置中在   module.exports = {}  中添加)

     head: {
        meta: [
          { charset: 'utf-8' },
          { name: 'viewport', content: 'width=device-width, initial-scale=1' },
          { hid: 'description', name: 'description', content: pkg.description }
        ],
        link: [
          { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
          { rel: 'stylesheet', href:   'https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css'},   //外部引入css方式
        
    { rel: 'stylesheet', href: '/css/phone-reset.css'} // 内部引入会默认读取(static文件夹)
    ] },

    局部引入css   (在需要引入的vue文件里  module.exports = {} 中添加)

    head:{
        link : [
                { rel: 'stylesheet', href: '/css/index.css'}   // 内部引入会默认读取
         ]
    },
  • 相关阅读:
    2018.11.26
    JS数组
    JS2018.12.26
    手机游戏客户端架构设计
    IAP应用内购买
    cocos2dx如何优化内存的应用
    Homebrew
    OS X 文档
    Apple推送通知服务教程
    ajax分页
  • 原文地址:https://www.cnblogs.com/hpx2020/p/9766312.html
Copyright © 2011-2022 走看看