2. 封裝vdiv組件,常用樣式參數化傳遞
阿新 • • 發佈:2018-07-04
pro func asd color none css limit hello 優點
優點: 基本滿足盒子模型需求,基本頁面快速布局。
<template> <div :style="ssp"> textasasdasdas {{ss}} </div> </template> <script> export default { name: ‘HelloWorld‘, props:[‘ss‘], data () { return { msg: ‘Welcome to Your Vue.js App‘, firstName:‘ou‘, lastName:‘wen‘ } }, methods:{ }, computed:{ ssp: function(){ return `padding-left:200px;` } } } </script> <!-- Add "scoped" attribute to limit CSS to this component only --> <style scoped> h1, h2 { font-weight: normal; } ul { list-style-type: none; padding: 0; } li { display: inline-block; margin: 0 10px; } a { color: #42b983; } </style>
2. 封裝vdiv組件,常用樣式參數化傳遞