This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
::placeholder { /* Chrome/Opera/Safari */ | |
color: pink; | |
} | |
</style> | |
<input type="text" placeholder="占位符" /> | |
<textarea placeholder="占位符"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select> | |
<option value="" disabled selected>Select your option</option> | |
<option value="hurr">Durr</option> | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
select:required:invalid { | |
color: gray; | |
} | |
option[value=""][disabled] { | |
display: none; | |
} | |
option { | |
color: black; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let routerString = · | |
this is a sting contain a route link: <router-link>link</router-link> | |
·; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<component v-bind:is="currentView"></component> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<router-link to="/bar">Go to Bar</router-link> | |
<dynamic-link></dynamic-link> | |
<router-view></router-view> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<router-link to="/foo">Go to Foo</router-link> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('dynamic-link', { | |
template: '<component v-bind:is="transformed"/>', | |
data () { | |
return { | |
text: '<router-link to="/foo">Go to Foo</router-link>' | |
} | |
}, | |
computed: { | |
transformed () { | |
return { template: this.text } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
data () { | |
return { | |
text: '<router-link to="/foo">Go to Foo</router-link>' | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('dynamic-link', { | |
template: '<component v-bind:is="transformed"></component>', | |
props: ['text'], | |
computed: { | |
transformed () { | |
return { | |
template: this.text, | |
props: this.$options.props | |
} | |
} |