Skip to content

Commit

Permalink
🎨 全局样式和局部样式
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyongyu committed Sep 28, 2018
1 parent c4e9b5f commit 3ea5f01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/App.vue → src/TodoList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div>
<input type="text" v-model="inputValue">
<input class="item" type="text" v-model="inputValue">
<button @click="handleSubmit">提交</button>
</div>
<ul>
Expand Down
6 changes: 4 additions & 2 deletions src/components/TodoItem.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<li @click="handleDelete">{{content}}</li>
<li class="item" @click="handleDelete">{{content}}</li>
</template>

<script>
Expand All @@ -14,5 +14,7 @@ export default {
</script>

<style scoped>
.item {
color: blue;
}
</style>
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import TodoList from './TodoList'

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
el: '#app',
components: { App },
template: '<App/>'
components: { TodoList },
template: '<TodoList/>'
})

0 comments on commit 3ea5f01

Please sign in to comment.