Skip to content

Instantly share code, notes, and snippets.

@movii
movii / index.html
Created June 23, 2017 15:32
使用 CSS 伪类为 select 元素添加 placeholder: 1. 遇到的问题
<style>
::placeholder { /* Chrome/Opera/Safari */
color: pink;
}
</style>
<input type="text" placeholder="占位符" />
<textarea placeholder="占位符">
@movii
movii / index.html
Created June 23, 2017 15:37
使用 CSS 伪类为 select 元素添加 placeholder: 3. 伪类
<select>
<option value="" disabled selected>Select your option</option>
<option value="hurr">Durr</option>
</select>
@movii
movii / index.html
Last active June 23, 2017 15:38
使用 CSS 伪类为 select 元素添加 placeholder: 4. 可能是正确的答案
<style>
select:required:invalid {
color: gray;
}
option[value=""][disabled] {
display: none;
}
option {
color: black;
}
@movii
movii / main.js
Last active June 24, 2017 04:03
Vue.js Dynamically Compile <router-link />: 1. router string
let routerString = ·
this is a sting contain a route link: <router-link>link</router-link>
·;
@movii
movii / index.vue
Created June 24, 2017 04:01
Vue.js Dynamically Compile <router-link />: 2. dynamic component
<template>
<component v-bind:is="currentView"></component>
</template>
@movii
movii / index.html
Created June 24, 2017 04:04
Vue.js Dynamically Compile <router-link />: 3. demo - 1 html
<div id="app">
<router-link to="/bar">Go to Bar</router-link>
<dynamic-link></dynamic-link>
<router-view></router-view>
</div>
@movii
movii / router.vue
Created June 24, 2017 04:05
Vue.js Dynamically Compile <router-link />: 3. demo - 2 <router-link>
<router-link to="/foo">Go to Foo</router-link>
@movii
movii / dynameticLink.vue
Created June 24, 2017 04:06
Vue.js Dynamically Compile <router-link />: 3. demo - 2 component <dynametic-link>
@movii
movii / app.vue
Created June 24, 2017 04:13
Vue.js Dynamically Compile <router-link />: 4. another demo - 1 app.vue
new Vue({
data () {
return {
text: '<router-link to="/foo">Go to Foo</router-link>'
}
}
});
@movii
movii / dynamicLink.vue
Created June 24, 2017 04:14
Vue.js Dynamically Compile <router-link />: 4. another demo - 2 component <dynamic-link>