想嘗試用vue寫個網站,但是代碼寫的很low,很像h5,求大神指教怎么寫,怎么優化。這是我的代碼<template> <div class="head"> <div class="logo"> <img src="@/assets/logo.png" alt=""> </div> <div class="menu"> <img src="@/assets/menu.png" alt=""> </div> </div></template><script>export default { name: 'Header', data () { return { msg: '你好' } }}</script><!-- Add "scoped" attribute to limit CSS to this component only --><style scoped>.head{ width: 100%; height: 1.5rem; background-color:antiquewhite; position:relative;}.logo{ width: 4rem; height: 1.1rem; background-color: aquamarine; position: absolute; top:.2rem; left: .2rem;}.logo img{ width: 100%; height: 100%;}.menu{ width: 1rem; height: 1.1rem; background-color: azure; position: absolute; top: .2rem; right: .2rem;}.menu img{ width: 100%;}</style>
用vue寫手機端網頁代碼怎么優化?
一只名叫tom的貓
2019-03-11 16:15:20