vue樣式寫在data中,作用在:style上

久違°發表於2020-10-12

template:

<div :style="maskStyle"></div>

data:

maskStyle: {
    width: "100%",
    height: "100%",
    position: "fixed",
    top: "0",
    left: "0",
    backgroundColor: "rgba(0,0,0,.4)",
    zIndex: 2
  },

相關文章