q8164305
V2EX  ›  问与答

vue 怎么操作 dom 的位移

  •  
  •   q8164305 · Mar 7, 2018 · 2752 views
    This topic created in 3000 days ago, the information mentioned may be changed or developed.

    vue 可以很方便的绑定数据而不需要操作 dom,但是不操作 dom 也能操作位移么?,如果可以怎么操作

    6 replies    2018-03-07 14:15:45 +08:00
    codermagefox
        1
    codermagefox  
       Mar 7, 2018
    你可能还没有明白什么是 Vue.
    Troevil
        2
    Troevil  
       Mar 7, 2018
    思想要转变, 把位移需要修改的那个属性绑定到某一个变量, 你操作这个变量不就位移了吗
    ghostgril
        3
    ghostgril  
       Mar 7, 2018
    ref 啊
    ghostgril
        4
    ghostgril  
       Mar 7, 2018
    @Troevil 有时还是需要操作 dom 的
    BOYPT
        5
    BOYPT  
       Mar 7, 2018
    去重新看 vue 教程 [Class 与 Style 绑定] 章节
    ipwx
        6
    ipwx  
       Mar 7, 2018
    你可能还没有明白什么是 Vue。

    用 class 或者用 inline style。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2810 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 04:26 · PVG 12:26 · LAX 21:26 · JFK 00:26
    ♥ Do have faith in what you're doing.