webpack5打包.vue时,.vue里的样式不生效

<template>
  <div>
    <h2 :class="{tt:isTest}">{{message}}</h2>
    <h2 class="tt">{{message}}</h2>
    <button @click="btnClick">按钮</button>
  </div>
</template>

<script>
export default {
  name: "app",
  data(){
    return{
      message:'hello world',
      isTest:true,
    }
  },
  methods:{
    btnClick(){
      console.log("点击")
    }
  }
}
</script>

<style scoped>
.tt {
  color: red;
}

</style>
阅读 871
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题