Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
chore: better demo
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarrec committed Jul 31, 2020
1 parent f474ae8 commit a6a583f
Show file tree
Hide file tree
Showing 7 changed files with 9,049 additions and 8,393 deletions.
8 changes: 6 additions & 2 deletions demo/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
export default {
head: {
title: 'Directivue - Demo',
htmlAttrs: { lang: 'en' },
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover' }
{ name: 'description', content: 'Demonstration of Vue directives by directivue' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
]
},
modules: [
buildModules: [
'@nuxtjs/tailwindcss'
],
tailwindcss: {
configPath: '~/tailwind.config.js',
cssPath: '~/assets/css/tailwind.pcss'
},
plugins: [
Expand Down
15 changes: 15 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "directivue-demo",
"version": "0.0.0",
"license": "MIT",
"private": true,
"scripts": {
"dev": "nuxt",
"generate": "nuxt generate",
"start": "nuxt start"
},
"devDependencies": {
"@nuxtjs/tailwindcss": "latest",
"nuxt": "latest"
}
}
35 changes: 24 additions & 11 deletions demo/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
<template>
<main class="container h-screen mx-auto flex justify-center items-center">
<div class="grid grid-rows-2 grid-cols-2 gap-4 border-2 border-gray-500 p-4">
<button
v-for="color in ['bg-red-600', 'bg-green-600', 'bg-blue-600', 'bg-yellow-600']"
:key="color"
v-ripple
class="text-lg font-semibold focus:outline-none h-32 w-32 px-8 py-2"
:class="color"
>
Click Me
</button>
<main class="container h-screen mx-auto flex flex-col justify-center items-center">
<div class="grid gap-2">
<div>
<label for="autofocus" class="block text-2xl font-semibold mb-4">
AutoFocus
</label>
<input id="autofocus" v-auto-focus class="focus:outline-none w-full bg-transparent border-2 border-gray-500 rounded-md mb-4 px-4 py-2" placeholder="Type some text...">
</div>
<div>
<div class="text-2xl font-semibold mb-4">
Ripple
</div>
<div class="grid grid-rows-2 grid-cols-2 gap-4 border-2 border-gray-500 p-4">
<button
v-for="color in ['bg-red-600', 'bg-green-600', 'bg-blue-600', 'bg-yellow-600']"
:key="color"
v-ripple
class="text-lg font-semibold focus:outline-none h-32 w-32 px-8 py-2"
:class="color"
>
Click Me
</button>
</div>
</div>
</div>
</main>
</template>
5 changes: 3 additions & 2 deletions demo/plugins/directives.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vue from 'vue'
import { RippleDirective } from '../../dist'
import { AutoFocus, Ripple } from '../../dist'

Vue.directive('ripple', RippleDirective)
Vue.directive('autoFocus', AutoFocus)
Vue.directive('ripple', Ripple)
Loading

0 comments on commit a6a583f

Please sign in to comment.