-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
38 lines (36 loc) · 980 Bytes
/
Copy pathmain.js
File metadata and controls
38 lines (36 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import BootstrapVue from 'bootstrap-vue'
import mitt from 'mitt'
import infiniteScroll from 'vue-infinite-scroll'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
Vue.use(infiniteScroll)
Vue.mixin({
methods: {
onFileChange(e, theFile, theImage) {
theFile = e.target.files[0]
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.onload = () => {
console.log('read the file and setting img')
console.log(reader.result)
resolve(reader.result)
}
reader.onerror = reject
if (theFile) {
reader.readAsDataURL(theFile)
}
})
}
}
})
Vue.config.productionTip = false
const emitter = mitt()
Vue.prototype.$emitter = emitter
new Vue({
router,
render: function (h) { return h(App) }
}).$mount('#app')