Skip to content

Commit fba4d56

Browse files
committed
first commit
0 parents  commit fba4d56

22 files changed

+11569
-0
lines changed

.browserslistrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> 1%
2+
last 2 versions

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/build/
2+
/config/
3+
/dist/
4+
/*.js
5+
/test/unit/coverage/

.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
root: true,
3+
4+
env: {
5+
node: true,
6+
},
7+
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
8+
rules: {
9+
'no-console': 'off',
10+
'no-debugger': 'off',
11+
'no-unused-vars': 1,
12+
'vue/max-attributes-per-line': 'off'
13+
},
14+
parserOptions: {
15+
parser: 'babel-eslint',
16+
}
17+
}

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
# local env files
6+
.env.local
7+
.env.*.local
8+
9+
# Log files
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
14+
# Editor directories and files
15+
.idea
16+
.vscode
17+
*.suo
18+
*.ntvs*
19+
*.njsproj
20+
*.sln
21+
*.sw?

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"arrowParens": "always",
4+
"singleQuote": true,
5+
"eol": "lf"
6+
}

README.md

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# vuetify-cascader
2+
3+
A missing cascader select for vuetify
4+
5+
# Demo
6+
7+
http://vma.isocked.com/#/element/cascader/
8+
9+
![example](https://raw.githubusercontent.com/tookit/vuetify-cascader/master/docs/example.png)
10+
11+
# Installation
12+
13+
```
14+
# npm
15+
npm install vuetify-cascader
16+
17+
# Yarn
18+
yarn add vuetify-cascader
19+
```
20+
21+
# Usage
22+
23+
```
24+
<template>
25+
<v-app id="app">
26+
<v-container>
27+
<v-row>
28+
<v-col cols="12" md="6">
29+
<v-cascader
30+
v-model="selectedItem"
31+
label="Select Product"
32+
item-value="id"
33+
item-text="text"
34+
:items="items"
35+
outlined
36+
/>
37+
</v-col>
38+
</v-row>
39+
</v-container>
40+
</v-app>
41+
</template>
42+
43+
<script>
44+
import VCascader from './components/VCascader.vue'
45+
46+
export default {
47+
components: {
48+
VCascader,
49+
},
50+
51+
data() {
52+
return {
53+
items: [
54+
{
55+
id: 1,
56+
text: 'Phone',
57+
value: 'phone',
58+
children: [
59+
{
60+
id: 2,
61+
text: 'IPhone',
62+
value: 'iphone',
63+
children: [
64+
{
65+
id: 3,
66+
text: 'IPhone 12',
67+
value: 'iphone 12',
68+
},
69+
{
70+
id: 99,
71+
text: 'IPhone 8',
72+
value: 'iphone 8',
73+
},
74+
],
75+
},
76+
],
77+
},
78+
{
79+
id: 11,
80+
text: 'Computer',
81+
value: 'computer',
82+
children: [
83+
{
84+
id: 12,
85+
text: 'Mac',
86+
value: 'mac',
87+
children: [
88+
{
89+
id: 13,
90+
text: 'Mac Air',
91+
value: 'Mac air',
92+
},
93+
],
94+
},
95+
{
96+
id: 14,
97+
text: 'PC',
98+
value: 'PC',
99+
children: [
100+
{
101+
id: 15,
102+
text: 'Surface',
103+
value: 'surface ',
104+
},
105+
],
106+
},
107+
],
108+
},
109+
],
110+
selectedItem: null,
111+
}
112+
},
113+
}
114+
</script>
115+
116+
117+
```
118+
119+
For other uses see examples: https://github.com/tookit/vuetify-cascader/blob/master/src/App.vue

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["@vue/cli-plugin-babel/preset"]
3+
};

docs/example.png

12.5 KB
Loading

jest.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
preset: "@vue/cli-plugin-unit-jest"
3+
};

jsconfig.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"~/*": ["./*"],
6+
"@/*": ["./*"],
7+
"~~/*": ["./*"],
8+
"@@/*": ["./*"]
9+
}
10+
},
11+
"exclude": ["node_modules", ".nuxt", "dist"]
12+
}

package.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "veutify-cascader",
3+
"version": "0.1.0",
4+
"author": "Michael Wang<wangqiangshen@gmail.com>",
5+
"license": "MIT",
6+
"main": "dist/VCascader.common.js",
7+
"homepage": "https://github.com/tookit/vuetify-cascader",
8+
"scripts": {
9+
"serve": "vue-cli-service serve",
10+
"build": "vue-cli-service build",
11+
"test:unit": "vue-cli-service test:unit",
12+
"lint": "vue-cli-service lint",
13+
"build:lib": "vue-cli-service build --target lib --name VCascader src/components/VCascader.vue"
14+
},
15+
"dependencies": {
16+
"n-ary-tree": "^0.4.0",
17+
"vuetify": "^2.4.5"
18+
},
19+
"devDependencies": {
20+
"@vue/cli-plugin-babel": "~4.5.10",
21+
"@vue/cli-plugin-eslint": "~4.5.10",
22+
"@vue/cli-plugin-unit-jest": "~4.5.10",
23+
"@vue/cli-service": "~4.5.10",
24+
"@vue/eslint-config-prettier": "^6.0.0",
25+
"@vue/test-utils": "1.1.2",
26+
"babel-eslint": "^10.0.3",
27+
"core-js": "^3.8.2",
28+
"eslint": "^7.18.0",
29+
"eslint-plugin-prettier": "^3.3.1",
30+
"eslint-plugin-vue": "^7.4.1",
31+
"lint-staged": "^10.5.3",
32+
"prettier": "^2.2.1",
33+
"sass": "^1.32.4",
34+
"sass-loader": "^10.1.1",
35+
"vue": "^2.6.12",
36+
"vue-cli-plugin-vuetify": "^2.2.0",
37+
"vue-template-compiler": "^2.6.12",
38+
"vuetify": "^2.4.5",
39+
"vuetify-loader": "^1.7.2"
40+
},
41+
"gitHooks": {
42+
"pre-commit": "lint-staged"
43+
},
44+
"lint-staged": {
45+
"*.{js,jsx,vue}": [
46+
"vue-cli-service lint",
47+
"git add"
48+
]
49+
},
50+
"unpkg": "dist/VCascader.umd.min.js",
51+
"jsdelivr": "dist/VCascader.umd.min.js"
52+
}

public/favicon.ico

4.19 KB
Binary file not shown.

public/index.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
10+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
11+
</head>
12+
<body>
13+
<noscript>
14+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
15+
</noscript>
16+
<div id="app"></div>
17+
<!-- built files will be auto injected -->
18+
</body>
19+
</html>

src/App.vue

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<template>
2+
<v-app id="app">
3+
<v-container>
4+
<v-row>
5+
<v-col cols="12" md="6">
6+
<v-cascader
7+
v-model="selectedItem"
8+
label="Select Product"
9+
item-value="id"
10+
item-text="text"
11+
:items="items"
12+
outlined
13+
/>
14+
</v-col>
15+
</v-row>
16+
</v-container>
17+
</v-app>
18+
</template>
19+
20+
<script>
21+
import VCascader from './components/VCascader.vue'
22+
23+
export default {
24+
components: {
25+
VCascader,
26+
},
27+
28+
data() {
29+
return {
30+
items: [
31+
{
32+
id: 1,
33+
text: 'Phone',
34+
value: 'phone',
35+
children: [
36+
{
37+
id: 2,
38+
text: 'IPhone',
39+
value: 'iphone',
40+
children: [
41+
{
42+
id: 3,
43+
text: 'IPhone 12',
44+
value: 'iphone 12',
45+
},
46+
{
47+
id: 99,
48+
text: 'IPhone 8',
49+
value: 'iphone 8',
50+
},
51+
],
52+
},
53+
],
54+
},
55+
{
56+
id: 11,
57+
text: 'Computer',
58+
value: 'computer',
59+
children: [
60+
{
61+
id: 12,
62+
text: 'Mac',
63+
value: 'mac',
64+
children: [
65+
{
66+
id: 13,
67+
text: 'Mac Air',
68+
value: 'Mac air',
69+
},
70+
],
71+
},
72+
{
73+
id: 14,
74+
text: 'PC',
75+
value: 'PC',
76+
children: [
77+
{
78+
id: 15,
79+
text: 'Surface',
80+
value: 'surface ',
81+
},
82+
],
83+
},
84+
],
85+
},
86+
],
87+
selectedItem: 99,
88+
}
89+
},
90+
}
91+
</script>

src/components/VCascader.js

Whitespace-only changes.

0 commit comments

Comments
 (0)