|
+ Add upload files
|
-
-
+
+
|
|
- Active: {{upload.active}}
+ Active: {{$refs.upload ? $refs.upload.active : false}}
|
- Uploaded: {{upload.uploaded}}
+ Uploaded: {{$refs.upload ? $refs.upload.uploaded : true}}
|
- Drop active: {{upload.dropActive}}
+ Drop active: {{$refs.upload ? $refs.upload.dropActive : false}}
|
-
+
|
-
+
Drop ing
@@ -162,7 +169,6 @@ table th,table td {
diff --git a/example/Vuex.vue b/example/Vuex.vue
index ae39d4b..30f62b8 100644
--- a/example/Vuex.vue
+++ b/example/Vuex.vue
@@ -1,110 +1,32 @@
-
-
-
-
-
-
-
-
-
-
-
- | Index |
- ID |
- Name |
- Size |
- Progress |
- Speed |
- Active |
- Error |
- Success |
- Abort |
- Delete |
-
-
-
-
- | {{index}} |
- {{file.id}} |
- {{file.name}} |
- {{file.size | formatSize}} |
- {{file.progress}} |
- {{file.speed | formatSize}} |
- {{file.active}} |
- {{file.error}} |
- {{file.success}} |
- |
- |
-
-
-
-
-
+
+ Add upload files
+
-
diff --git a/example/index.js b/example/index.js
index fa8b71d..752030e 100644
--- a/example/index.js
+++ b/example/index.js
@@ -1,27 +1,14 @@
import Vue from 'vue'
-import VueRouter from 'vue-router'
-
-import App from './App'
import Home from './Home'
-import Multi from './Multi'
-import CrossRouter from './CrossRouter'
-import CrossRouterUpload from './CrossRouterUpload'
-import CrossRouterList from './CrossRouterList'
-import VuexComponent from './Vuex'
import store from './store'
-Vue.use(VueRouter)
Vue.config.silent = false;
Vue.config.devtools = true;
-
-
-
-
Vue.filter('formatSize', function(size) {
if (size > 1024 * 1024 * 1024 * 1024) {
return (size / 1024 / 1024 / 1024 / 1024).toFixed(2) + ' TB';
@@ -39,37 +26,7 @@ Vue.filter('formatSize', function(size) {
-const router = new VueRouter({
- mode: 'history',
- base: __dirname,
- routes: [
- {
- path: '/',
- component: Home
- },
- {
- path: '/multi',
- component: Multi
- },
- {
- path: '/cross-router',
- component: CrossRouter,
- children: [
- { path: '', component: CrossRouterUpload },
- { path: 'list', component: CrossRouterList }
- ]
- },
- {
- path: '/vuex',
- component: VuexComponent,
- },
- ]
-})
-
-
-
new Vue({
- router,
store,
- ...App
+ ...Home
}).$mount('#app')
diff --git a/example/store.js b/example/store.js
index 441f6da..cb1c4e1 100644
--- a/example/store.js
+++ b/example/store.js
@@ -10,37 +10,12 @@ const state = {
}
const mutations = {
- addFile (state, file) {
- state.files.push(file)
- },
- updateFile (state, {oldFile, newFile}) {
- var index = state.files.indexOf(oldFile)
- if (index == -1) {
- return
- }
- state.files.splice(index, 1, newFile);
- },
- removeFile(state, file) {
- var index = state.files.indexOf(file)
- if (index != -1) {
- state.files.splice(index, 1);
- }
- },
+ updateFiles(state, files) {
+ state.files = files
+ }
}
-
-const actions = {
-
-}
-
-const getters = {
-
-}
-
-
export default new Vuex.Store({
- strict: process.env.NODE_ENV !== 'production',
+ strict: true,
state,
- getters,
- actions,
mutations
})
diff --git a/index.html b/index.html
index 51e93f9..6f2ad68 100644
--- a/index.html
+++ b/index.html
@@ -5,9 +5,8 @@
vue-upload-component
-
-
-
+
+