Skip to content

Commit

Permalink
(feature)格式化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
jingchenxu committed Sep 20, 2018
1 parent 2a79bb9 commit b964331
Show file tree
Hide file tree
Showing 26 changed files with 90 additions and 772 deletions.
Binary file removed output.js
Binary file not shown.
38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
},
"win": {
"icon": "./public/win.ico",
"publish": ["github"]
"publish": [
"github"
]
},
"nsis": {
"oneClick": false,
Expand All @@ -43,31 +45,31 @@
"build-win": "build --win --x64"
},
"dependencies": {
"mysql": "^2.16.0",
"nedb": "^1.8.0",
"register-service-worker": "^1.0.0",
"vue": "^2.5.17",
"vue-class-component": "^6.0.0",
"vue-property-decorator": "^7.0.0",
"vue-router": "^3.0.1",
"vuetify": "^1.0.19",
"vuex": "^3.0.1",
"bignumber.js": "^4.1.0",
"readable-stream": "^2.3.6",
"safe-buffer": "^5.1.2",
"sqlstring": "^2.3.1",
"async": "^0.2.10",
"bignumber.js": "^4.1.0",
"binary-search-tree": "^0.2.5",
"localforage": "^1.3.0",
"mkdirp": "^0.5.1",
"underscore": "^1.4.4",
"core-util-is": "^1.0.2",
"immediate": "^3.0.6",
"inherits": "^2.0.3",
"isarray": "^1.0.0",
"lie": "^3.1.1",
"localforage": "^1.3.0",
"mkdirp": "^0.5.1",
"mysql": "^2.16.0",
"nedb": "^1.8.0",
"process-nextick-args": "^2.0.0",
"util-deprecate": "^1.0.2"
"readable-stream": "^2.3.6",
"register-service-worker": "^1.0.0",
"safe-buffer": "^5.1.2",
"sqlstring": "^2.3.1",
"underscore": "^1.4.4",
"util-deprecate": "^1.0.2",
"vue": "^2.5.17",
"vue-class-component": "^6.0.0",
"vue-property-decorator": "^7.0.0",
"vue-router": "^3.0.1",
"vuetify": "^1.0.19",
"vuex": "^3.0.1"
},
"devDependencies": {
"@babel/polyfill": "^7.0.0-beta.49",
Expand Down
8 changes: 4 additions & 4 deletions src/components/AddCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<v-btn slot="activator" small icon>
<v-icon small color="grey">mdi-palette</v-icon>
</v-btn>
<ColorSelector/>
更改颜色
</v-tooltip>
<v-btn small icon>
<v-icon small color="grey">image</v-icon>
Expand All @@ -74,13 +74,14 @@
</template>

<script>
const {ipcRenderer} = window.require('electron')
import ColorSelector from './ColorSelector'
const { ipcRenderer } = window.require('electron')
export default {
name: 'add-card',
components: {
ColorSelector
ColorSelector,
Tooltip
},
data () {
return {
Expand Down Expand Up @@ -141,4 +142,3 @@ export default {
}
}
</style>

2 changes: 0 additions & 2 deletions src/components/ColorSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ export default {
background-color: grey;
}
</style>


35 changes: 17 additions & 18 deletions src/components/LabelItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@
</template>

<script>
export default {
name: 'label-item',
data () {
return {
message: 'Hey!',
loading: false
}
},
methods: {
clickMe () {
this.loading = true
this.message = 'Wait for it...'
setTimeout(() => {
this.loading = false
this.message = 'You\'ve clicked me!'
}, 2000)
}
export default {
name: 'label-item',
data () {
return {
message: 'Hey!',
loading: false
}
},
methods: {
clickMe () {
this.loading = true
this.message = 'Wait for it...'
setTimeout(() => {
this.loading = false
this.message = 'You\'ve clicked me!'
}, 2000)
}
}
}
</script>

20 changes: 11 additions & 9 deletions src/components/NoteCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
</template>

<script>
let { ipcRenderer } = window.require('electron')
import NoteCardActions from './NoteCardActions'
let { ipcRenderer } = window.require('electron')
export default {
name: 'note-card',
Expand All @@ -80,26 +80,28 @@ export default {
noteDetail: {
type: Object,
required: false,
default: {
noteTitle: 'note title',
noteContent: 'note content'
default: function () {
return {
noteTitle: 'note title',
noteContent: 'note content'
}
}
}
},
data () {
return {
card: { title: 'Favorite road trips', src: 'https://cdn.vuetifyjs.com/images/cards/road.jpg', flex: 6 },
dialog: false,
note: {},
note: {}
}
},
mounted () {
let me = this
me.updateNoteSize()
window.onresize = function () {
setTimeout( function() {
setTimeout(function () {
me.updateNoteSize()
},1000)
}, 1000)
}
},
computed: {
Expand Down Expand Up @@ -151,9 +153,9 @@ export default {
// 开始更行vuex中对应的数据
let noteList = me.$store.state.noteList
for (let i=0; i<noteList.length; i++) {
if (noteList[i].id === me._props.noteDetail.id ) {
if (noteList[i].id === me._props.noteDetail.id) {
noteList[i].width = me.getNoteWidth() ? me.getNoteWidth() : 300
noteList[i].height = me.getNoteHeight() ? me.getNoteHeight() : 400
noteList[i].height = me.getNoteHeight() ? me.getNoteHeight() : 400
}
}
me.$store.commit('setNoteList', noteList)
Expand Down
3 changes: 1 addition & 2 deletions src/components/NoteCardActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
{ title: '添加标签' },
{ title: '添加绘图' },
{ title: '复制' }
],
]
}
}
}
Expand All @@ -76,4 +76,3 @@ export default {
height: auto;
}
</style>

27 changes: 16 additions & 11 deletions src/components/NoteGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@
<div :key="index" v-for="(item, index) in noteList" class="item">
<NoteCard :noteDetail="item"></NoteCard>
</div>
<div class="list-title">
已固定的记事
<div v-if="groupTitle" class="list-title">
{{groupTitle}}
</div>
</div>
</div>
</div>
</template>

<script>
import NoteCard from './NoteCard.vue'
import { setTimeout } from 'timers';
import { setTimeout } from 'timers'
export default {
name: 'downloads',
components: {
NoteCard
},
props: {
groupTitle: {
type: String,
required: false
}
},
data () {
return {
sizeType: 1,
Expand Down Expand Up @@ -47,20 +53,20 @@ export default {
*/
delayUpdate () {
let me = this
setTimeout(function(){
setTimeout(function () {
me.updateLayout()
window.onresize = function () {
me.updateLayout()
}
},1)
}, 1)
},
/**
* @author jingchenxu2015@gmail.com
* @description 更新页面布局 只有在页面布局发生大的改动的时候才会触发
*/
updateLayout () {
let me = this
let items = document.getElementsByClassName("item")
let items = document.getElementsByClassName('item')
me.items = items
let width = document.body.clientWidth
let heightList
Expand Down Expand Up @@ -107,7 +113,7 @@ export default {
*/
countPosition3 (index, x, y, itemHeight) {
let me = this
let order = index%3
if (order === 0) {
x = 0
Expand Down Expand Up @@ -144,9 +150,9 @@ export default {
*/
countPosition2 (index, x, y, itemHeight) {
let me = this
if (me._isOdd(index)) {
x = 0;
x = 0
if (index>0) {
itemHeight = this.items[index-2].offsetHeight
me.heightList[0] = me.heightList[0] + itemHeight + 16
Expand Down Expand Up @@ -276,4 +282,3 @@ export default {
}
}
</style>

76 changes: 0 additions & 76 deletions src/components/WaterSlot.vue

This file was deleted.

Loading

0 comments on commit b964331

Please sign in to comment.