推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
astome

vue.js 的 css 加载问题

  •  
  •   astome · May 24, 2017 · 5024 views
    This topic created in 3276 days ago, the information mentioned may be changed or developed.

    vue 开发时 css 重叠加载 导致开发过程 整体项目样式错乱,大神们 是怎么解决的啊 用 scoped 也解决不了

    <style scoped=""> @import "../../assets/styles/act061118.min_af85472.css" </style>
    10 replies    2017-05-24 18:10:53 +08:00
    xing393939
        1
    xing393939  
       May 24, 2017
    我现在觉得就不该有 scoped 这种特性的存在,要是需要不同样式不如用 class 区分
    astome
        2
    astome  
    OP
       May 24, 2017
    @xing393939 组件内的 css 都有作用域的吧 不然其它组件内的 css 文件相互干扰 导致整体项目 样式都变了
    Arrowing
        3
    Arrowing  
       May 24, 2017
    @astome 想多了,最后还是放到同一个页面里的,单组件 vue 文件也仅仅是为了开发方便而已
    DualWield
        4
    DualWield  
       May 24, 2017
    @Arrowing scoped 的 css 虽然最后会放在同一个页面里,但是做一些处理,比如<div class="test"></div> .test { color: XXX} 会处理成 <div _v1234></div> [v_1234] { color: XXX } 所以是 scoped
    coo
        5
    coo  
       May 24, 2017
    Vue 的 scoped 在有些时候与期望效果不符,还是用 class 命名来解决比较好。
    pathen
        6
    pathen  
       May 24, 2017 via Android
    这不是一个 scope 问题,而是工程化问题,好好捋捋代码吧
    astome
        7
    astome  
    OP
       May 24, 2017
    @pathen 说的有道理
    astome
        8
    astome  
    OP
       May 24, 2017
    @DualWield 谢谢大神
    xmflswood
        9
    xmflswood  
       May 24, 2017
    <style scoped src="../../assets/styles/act061118.min_af85472.css"></style>
    Trim21
        10
    Trim21  
       May 24, 2017 via Android
    脚手架里面是<style scoped>。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5856 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 01:52 · PVG 09:52 · LAX 18:52 · JFK 21:52
    ♥ Do have faith in what you're doing.