├── .editorconfig ├── .gitignore ├── README.md ├── dev ├── App.vue └── index.js ├── package.json ├── poi.config.js ├── src ├── VueCheckList.vue ├── index.js └── styles │ ├── check-list.scss │ └── common.scss └── test ├── index.js └── test.vue /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Using Vue2.0 CheckList component 2 | 3 | ## Install 4 | 5 | You can use Yarn or NPM 6 | ```bash 7 | npm install -S vue2-checklist 8 | ``` 9 | OR 10 | ```bash 11 | yarn add vue2-checklist 12 | ``` 13 | 14 | ## Usage 15 | 16 | ```js 17 | // In components 18 | import Vue2Checklist from 'vue2-checklist' 19 | 20 | // In main You can add this 21 | Vue.use(Vue2Checklist) 22 | ``` 23 | 24 | ## Props 25 | |Name|Type|Default|Description| 26 | |:----- |:------|:------|:------| 27 | |visible |Boolean |false |visibility of dialog | 28 | |data |Array |- |Table data | 29 | |maxlength |Number |2 |same as maxlength in native select | 30 | 31 | 32 | ## Methods 33 | |Method Name|Description|Parameters| 34 | |:----- |:------|:------| 35 | |on-cancel |hook function when dialog cancel |dialog state | 36 | |on-change |triggers when the selected value changes |current selected value | 37 | 38 | ## Example 39 | 40 | ```vue 41 | 53 | 54 | 81 | 82 | 87 | ``` 88 | 89 | ## Development 90 | 91 | Vue2Checklist now uses Poi for development 92 | 93 | * yarn dev: Run example in development mode 94 | * yarn build: Build component in both format 95 | * yearn test: Run test component 96 | 97 | ## License 98 | 99 | MIT 100 | -------------------------------------------------------------------------------- /dev/App.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 63 | 64 | 65 | 70 | -------------------------------------------------------------------------------- /dev/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | new Vue({ 5 | el: '#app', 6 | render: h => h(App) 7 | }) 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue2-checklist", 3 | "version": "1.2.9", 4 | "description": "checklist using vue2.0", 5 | "keywords": [ 6 | "vue2-checklist", 7 | "checklist" 8 | ], 9 | "author": "angelasubi", 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/angelasubi/vue2-checklist.git" 13 | }, 14 | "main": "dist/vue2-checklist.js", 15 | "files": [ 16 | "dist" 17 | ], 18 | "scripts": { 19 | "dev": "poi dev/index.js", 20 | "build": "poi build ./src/index.js --library Vue2CheckList", 21 | "test": "poi test/index.js" 22 | }, 23 | "devDependencies": { 24 | "node-sass": "^4.7.2", 25 | "sass-loader": "^6.0.6" 26 | }, 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/angelasubi/vue2-checklist/issues" 30 | }, 31 | "homepage": "https://github.com/angelasubi/vue2-checklist#readme" 32 | } 33 | -------------------------------------------------------------------------------- /poi.config.js: -------------------------------------------------------------------------------- 1 | const path = require(`path`) 2 | 3 | module.exports = { 4 | extractCSS: false, 5 | entry: path.resolve(__dirname, './dev/index.js'), 6 | vendor: false, 7 | filename: { 8 | js: 'vue2-checklist.js' 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/VueCheckList.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Vue2-CheckList 3 | */ 4 | import VueCheckList from './VueCheckList.vue' 5 | 6 | const Vue2CheckList = { 7 | install: function(Vue) { 8 | Vue.component(VueCheckList.name, VueCheckList) 9 | } 10 | } 11 | 12 | if (typeof window !== 'undefined' && window.Vue) { 13 | window.Vue.use(Vue2CheckList) 14 | } 15 | 16 | export default Vue2CheckList 17 | export { VueCheckList } 18 | -------------------------------------------------------------------------------- /src/styles/check-list.scss: -------------------------------------------------------------------------------- 1 | .vue2-checklist { 2 | .content { 3 | width: 100%; 4 | position: fixed; 5 | bottom: 0; 6 | z-index: 199; 7 | background-color: #fff; 8 | .topbar { 9 | display: -webkit-flex; 10 | display: flex; 11 | justify-content: space-between; 12 | align-items: center; 13 | height: 44px; 14 | font-size: 16px; 15 | padding: 6px 15px; 16 | border-bottom: 1px solid #E5E5E5; 17 | .cancel { 18 | color: #888; 19 | } 20 | .success { 21 | color: #1AAD19 22 | } 23 | } 24 | .desc { 25 | font-size: 14px; 26 | text-align: right; 27 | color: #c1bebe; 28 | padding: 4px 10px 2px 0; 29 | } 30 | .list { 31 | height: 200px; 32 | padding: 10px 15px; 33 | overflow-y: auto; 34 | -webkit-overflow-scrolling: touch; 35 | overflow-scrolling: touch; 36 | .line { 37 | border-bottom: 1px solid #f5f5f5; 38 | .p { 39 | display: -webkit-flex; 40 | display: flex; 41 | justify-content: center; 42 | align-items: center; 43 | height: 40px; 44 | .cont { 45 | display: -webkit-flex; 46 | display: flex; 47 | flex-direction: column; 48 | justify-content: center; 49 | align-items: flex-start; 50 | width: 90%; 51 | } 52 | .rad { 53 | width: 22px; 54 | height: 22px; 55 | border-radius: 50%; 56 | background-color: #09BB07; 57 | color: #fff; 58 | text-align: center; 59 | line-height: 22px; 60 | } 61 | .dis-rad { 62 | width: 20px; 63 | height: 20px; 64 | border-radius: 50%; 65 | border: 1px solid #C9C9C9; 66 | background-color: #fff; 67 | color: #fff; 68 | text-align: center; 69 | line-height: 20px; 70 | } 71 | .check-disabled { 72 | width: 20px; 73 | height: 20px; 74 | border-radius: 50%; 75 | border: 1px solid #C9C9C9; 76 | background-color: #C9C9C9; 77 | color: #C9C9C9; 78 | text-align: center; 79 | line-height: 20px; 80 | } 81 | } 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/styles/common.scss: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | .mask { 5 | position: fixed; 6 | top: 0; 7 | left: 0; 8 | right: 0; 9 | bottom: 0; 10 | z-index: 188; 11 | background: rgba(0, 0, 0, .5); 12 | transition: all .5s; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Test from './test.vue' 3 | 4 | import Vue2Checklist from '../dist/vue2-checklist.js' 5 | 6 | Vue.use(Vue2Checklist) 7 | 8 | new Vue({ 9 | el: '#app', 10 | render: h => h(Test) 11 | }) 12 | -------------------------------------------------------------------------------- /test/test.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 45 | 46 | 51 | --------------------------------------------------------------------------------