Skip to content

Commit

Permalink
docs(examples): Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rkunev committed May 6, 2020
1 parent 14575aa commit 9fcd7da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 9 additions & 2 deletions examples/with-config/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:variant="step"
@input="onInput"
@change="onChange"
@select="onSelect"
/>
<h1>{{ msg }}</h1>
<pre>{{ { hue, saturation, luminosity, alpha } }}</pre>
Expand Down Expand Up @@ -46,13 +47,19 @@ export default {
};
},
methods: {
// Emitted every time the color changes (i.e. rotation of the wheel).
// Emitted every time the color updates (i.e. rotation of the wheel).
onInput(hue) {
this.hue = hue;
},
// Emitted when the user dismisses the color picker (i.e. interacting with the middle color well).
// Emitted after the user releases the knob
onChange(hue) {
this.hue = hue;
console.log('Color changed. User selected:', hue);
},
// Emitted when the user dismisses the color picker (i.e. interacting with the middle color well).
onSelect(hue) {
console.log('Color picker was dismissed', hue);
},
},
Expand Down
3 changes: 0 additions & 3 deletions examples/with-nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@
"dependencies": {
"@radial-color-picker/vue-color-picker": "latest",
"nuxt": "^2.0.0"
},
"devDependencies": {
"nodemon": "^1.18.9"
}
}
7 changes: 2 additions & 5 deletions examples/with-nuxt/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
</template>

<script>
import ColorPicker from '@radial-color-picker/vue-color-picker';
// Note: you don't have to import and declare the color-picker component
// This is done automatically in `nuxt.config.js`
export default {
components: {
ColorPicker,
},
data() {
return {
msg: 'Welcome to Your Vue.js App',
Expand Down

0 comments on commit 9fcd7da

Please sign in to comment.