Make data() a function

This commit is contained in:
Maxim Filippov 2019-02-22 21:06:48 +03:00
parent da6fb12aa2
commit 83fc9e6aa8
78 changed files with 94 additions and 77 deletions

View file

@ -42,7 +42,7 @@ export default {
default: 'fade'
}
},
data() {
data: function() {
return {
visible: false,
interval: null,

View file

@ -15,7 +15,7 @@ import { generateTitle } from '@/utils/i18n'
import pathToRegexp from 'path-to-regexp'
export default {
data() {
data: function() {
return {
levelList: null
}

View file

@ -26,7 +26,7 @@ export default {
default: '200px'
}
},
data() {
data: function() {
return {
chart: null
}

View file

@ -26,7 +26,7 @@ export default {
default: '200px'
}
},
data() {
data: function() {
return {
chart: null
}

View file

@ -26,7 +26,7 @@ export default {
default: '200px'
}
},
data() {
data: function() {
return {
chart: null
}

View file

@ -1,7 +1,7 @@
import { debounce } from '@/utils'
export default {
data() {
data: function() {
return {
sidebarElm: null
}

View file

@ -70,7 +70,7 @@ export default {
default: false
}
},
data() {
data: function() {
return {
dropzone: '',
initOnce: true

View file

@ -40,7 +40,7 @@
<script>
export default {
name: 'ErrorLog',
data() {
data: function() {
return {
dialogTableVisible: false
}

View file

@ -23,7 +23,7 @@ import i18n from '@/lang'
export default {
name: 'HeaderSearch',
data() {
data: function() {
return {
search: '',
options: [],

View file

@ -195,7 +195,7 @@ export default {
'default': false
}
},
data() {
data: function() {
const that = this
const {
imgFormat,

View file

@ -18,7 +18,7 @@ export default {
name: 'JsonEditor',
/* eslint-disable vue/require-prop-types */
props: ['value'],
data() {
data: function() {
return {
jsonEditor: false
}

View file

@ -138,7 +138,7 @@ export default {
default: true
}
},
data() {
data: function() {
return {
currentValue: this.value,
focus: false,

View file

@ -46,7 +46,7 @@ export default {
default: 'en_US' // https://github.com/nhnent/tui.editor/tree/master/src/js/langs
}
},
data() {
data: function() {
return {
editor: null
}

View file

@ -9,7 +9,7 @@ import screenfull from 'screenfull'
export default {
name: 'Screenfull',
data() {
data: function() {
return {
isFullscreen: false
}

View file

@ -9,7 +9,7 @@ const tagAndTagSpacing = 4 // tagAndTagSpacing
export default {
name: 'ScrollPane',
data() {
data: function() {
return {
left: 0
}

View file

@ -24,7 +24,7 @@ export default {
default: 'vue'
}
},
data() {
data: function() {
return {
isActive: false
}

View file

@ -12,7 +12,7 @@
<script>
export default {
data() {
data: function() {
return {
sizeOptions: [
{ label: 'Default', value: 'default' },

View file

@ -25,7 +25,7 @@ export default {
default: ''
}
},
data() {
data: function() {
return {
active: false,
position: '',

View file

@ -11,7 +11,7 @@ const version = require('element-ui/package.json').version // element-ui version
const ORIGINAL_THEME = '#409EFF' // default color
export default {
data() {
data: function() {
return {
chalk: '', // content of theme-chalk css
theme: ORIGINAL_THEME

View file

@ -32,7 +32,7 @@ export default {
default: '#1890ff'
}
},
data() {
data: function() {
return {
dialogVisible: false,
listObj: {},

View file

@ -43,7 +43,7 @@ export default {
default: 360
}
},
data() {
data: function() {
return {
hasChange: false,
hasInit: false,

View file

@ -34,7 +34,7 @@ export default {
default: ''
}
},
data() {
data: function() {
return {
tempUrl: '',
dataObj: { token: '', key: '' }

View file

@ -33,7 +33,7 @@ export default {
default: ''
}
},
data() {
data: function() {
return {
tempUrl: '',
dataObj: { token: '', key: '' }

View file

@ -41,7 +41,7 @@ export default {
default: ''
}
},
data() {
data: function() {
return {
tempUrl: '',
dataObj: { token: '', key: '' }

View file

@ -16,7 +16,7 @@ export default {
beforeUpload: Function, // eslint-disable-line
onSuccess: Function// eslint-disable-line
},
data() {
data: function() {
return {
loading: false,
excelData: {

View file

@ -22,7 +22,7 @@ export default {
directives: {
clipboard
},
data() {
data: function() {
return {
activeName: 'directly',
inputData: 'https://github.com/PanJiaChen/vue-element-admin'

View file

@ -29,7 +29,7 @@ import PanThumb from '@/components/PanThumb'
export default {
name: 'AvatarUploadDemo',
components: { ImageCropper, PanThumb },
data() {
data: function() {
return {
imagecropperShow: false,
imagecropperKey: 0,

View file

@ -127,7 +127,7 @@ import BackToTop from '@/components/BackToTop'
export default {
name: 'BackToTopDemo',
components: { BackToTop },
data() {
data: function() {
return {
myBackToTopStyle: {
right: '50px',

View file

@ -52,7 +52,7 @@ import countTo from 'vue-count-to'
export default {
name: 'CountToDemo',
components: { countTo },
data() {
data: function() {
return {
setStartVal: 0,
setEndVal: 2017,

View file

@ -16,7 +16,7 @@ import { fetchList } from '@/api/article'
export default {
name: 'DndListDemo',
components: { DndList },
data() {
data: function() {
return {
list1: [],
list2: []

View file

@ -20,7 +20,7 @@ import elDragDialog from '@/directive/el-dragDialog' // base on element-ui
export default {
name: 'DragDialogDemo',
directives: { elDragDialog },
data() {
data: function() {
return {
dialogTableVisible: false,
options: [

View file

@ -13,7 +13,7 @@ export default {
components: {
Kanban
},
data() {
data: function() {
return {
options: {
group: 'mission'

View file

@ -18,7 +18,7 @@ import ElDragSelect from '@/components/DragSelect' // base on element-ui
export default {
name: 'DragSelectDemo',
components: { ElDragSelect },
data() {
data: function() {
return {
value: ['Apple', 'Banana', 'Orange'],
options: [{

View file

@ -15,7 +15,7 @@ const jsonData = '[{"items":[{"market_type":"forexdata","symbol":"XAUUSD"},{"mar
export default {
name: 'JsonEditorDemo',
components: { JsonEditor },
data() {
data: function() {
return {
value: JSON.parse(jsonData)
}

View file

@ -52,7 +52,7 @@ const content = `
export default {
name: 'MarkdownDemo',
components: { MarkdownEditor },
data() {
data: function() {
return {
content: content,
html: '',

View file

@ -114,7 +114,7 @@ export default {
directives: {
waves
},
data() {
data: function() {
const validate = (rule, value, callback) => {
if (value.length !== 6) {
callback(new Error('请输入六个字符'))

View file

@ -97,7 +97,7 @@ import Sticky from '@/components/Sticky'
export default {
name: 'StickyDemo',
components: { Sticky },
data() {
data: function() {
return {
time: '',
url: '',

View file

@ -17,7 +17,7 @@ import Tinymce from '@/components/Tinymce'
export default {
name: 'TinymceDemo',
components: { Tinymce },
data() {
data: function() {
return {
content:
`<h1 style="text-align: center;">Welcome to the TinyMCE demo!</h1><p style="text-align: center; font-size: 15px;"><img title="TinyMCE Logo" src="//www.tinymce.com/images/glyph-tinymce@2x.png" alt="TinyMCE Logo" width="110" height="97" /><ul>

View file

@ -24,7 +24,7 @@ export default {
default: '300px'
}
},
data() {
data: function() {
return {
chart: null
}

View file

@ -43,7 +43,7 @@ export default {
return statusMap[status]
}
},
data() {
data: function() {
return {
statisticsData: {
article_count: 1024,

View file

@ -30,7 +30,7 @@ export default {
required: true
}
},
data() {
data: function() {
return {
chart: null,
sidebarElm: null

View file

@ -22,7 +22,7 @@ export default {
default: '300px'
}
},
data() {
data: function() {
return {
chart: null
}

View file

@ -24,7 +24,7 @@ export default {
default: '300px'
}
},
data() {
data: function() {
return {
chart: null
}

View file

@ -40,7 +40,7 @@ export default {
}
}
},
data() {
data: function() {
return {
editing: false
}

View file

@ -61,7 +61,7 @@ export default {
pluralize: (n, w) => n === 1 ? w : w + 's',
capitalize: s => s.charAt(0).toUpperCase() + s.slice(1)
},
data() {
data: function() {
return {
visibility: 'all',
filters,

View file

@ -34,7 +34,7 @@ export default {
return str.substring(0, 30)
}
},
data() {
data: function() {
return {
list: null
}

View file

@ -85,7 +85,7 @@ export default {
TodoList,
BoxCard
},
data() {
data: function() {
return {
lineChartData: lineChartData.newVisitis
}

View file

@ -24,7 +24,7 @@ import GithubCorner from '@/components/GithubCorner'
export default {
name: 'DashboardEditor',
components: { PanThumb, GithubCorner },
data() {
data: function() {
return {
emptyGif: 'https://wpimg.wallstcn.com/0e03b7da-db9e-4819-ba10-9016ddfdaed3'
}

View file

@ -12,7 +12,7 @@ import editorDashboard from './editor'
export default {
name: 'Dashboard',
components: { adminDashboard, editorDashboard },
data() {
data: function() {
return {
currentRole: 'adminDashboard'
}

View file

@ -12,7 +12,7 @@ import DropdownMenu from '@/components/Share/dropdownMenu'
export default {
name: 'Documentation',
components: { DropdownMenu },
data() {
data: function() {
return {
articleList: [
{ title: '基础篇', href: 'https://juejin.im/post/59097cd7a22b9d0065fb61d2' },

View file

@ -31,7 +31,7 @@ import errGif from '@/assets/401_images/401.gif'
export default {
name: 'Page401',
data() {
data: function() {
return {
errGif: errGif + '?' + +new Date(),
ewizardClap: 'https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646',

View file

@ -107,7 +107,7 @@ export default {
default: false
}
},
data() {
data: function() {
const validateRequire = (rule, value, callback) => {
if (value === '') {
this.$message({

View file

@ -23,7 +23,7 @@ export default {
type: Array
}
},
data() {
data: function() {
return {
platformsOptions: [
{ key: 'a-platform', name: 'a-platform' },

View file

@ -72,7 +72,7 @@ export default {
return statusMap[status]
}
},
data() {
data: function() {
return {
list: null,
total: 0,

View file

@ -19,7 +19,7 @@ export default {
default: 'xlsx'
}
},
data() {
data: function() {
return {
options: ['xlsx', 'csv', 'txt']
}

View file

@ -55,7 +55,7 @@ import BookTypeOption from './components/BookTypeOption'
export default {
name: 'ExportExcel',
components: { FilenameOption, AutoWidthOption, BookTypeOption },
data() {
data: function() {
return {
list: null,
listLoading: true,

View file

@ -51,7 +51,7 @@ import { fetchList } from '@/api/article'
export default {
name: 'SelectExcel',
data() {
data: function() {
return {
list: null,
listLoading: true,

View file

@ -13,7 +13,7 @@ import UploadExcelComponent from '@/components/UploadExcel/index.vue'
export default {
name: 'UploadExcel',
components: { UploadExcelComponent },
data() {
data: function() {
return {
tableData: [],
tableHeader: []

View file

@ -16,7 +16,7 @@ import steps from './defineSteps'
export default {
name: 'Guide',
data() {
data: function() {
return {
driver: null
}

View file

@ -55,7 +55,7 @@ const viewName = 'i18nView'
export default {
name: 'I18n',
data() {
data: function() {
return {
date: '',
tableData: [{

View file

@ -63,7 +63,7 @@ export default {
default: ''
}
},
data() {
data: function() {
return {
onlyOneChild: null
}

View file

@ -32,7 +32,7 @@ import path from 'path'
export default {
components: { ScrollPane },
data() {
data: function() {
return {
visible: false,
top: 0,

View file

@ -13,7 +13,7 @@
<script>
export default {
data() {
data: function() {
return {
article: '',
fullscreenLoading: true

View file

@ -63,7 +63,7 @@ export default{
name: 'DirectivePermission',
components: { SwitchRoles },
directives: { permission },
data() {
data: function() {
return {
key: 1 //
}

View file

@ -11,7 +11,7 @@ import { getToken } from '@/api/qiniu'
// sdk https://developer.qiniu.com/sdk#official-sdk
export default{
data() {
data: function() {
return {
dataObj: { token: '', key: '' },
image_uri: [],

View file

@ -26,7 +26,7 @@ import clipboard from '@/utils/clipboard'
export default {
name: 'Icons',
data() {
data: function() {
return {
iconsMap: icons
}

View file

@ -72,7 +72,7 @@ export default {
default: 'CN'
}
},
data() {
data: function() {
return {
list: null,
listQuery: {

View file

@ -18,7 +18,7 @@ import tabPane from './components/tabPane'
export default {
name: 'Tab',
components: { tabPane },
data() {
data: function() {
return {
tabMapOptions: [
{ label: 'China', key: 'CN' },

View file

@ -163,7 +163,7 @@ export default {
return calendarTypeKeyValue[type]
}
},
data() {
data: function() {
return {
tableKey: 0,
list: null,

View file

@ -75,7 +75,7 @@ export default {
return statusMap[status]
}
},
data() {
data: function() {
return {
list: null,
total: null,

View file

@ -25,7 +25,7 @@
const defaultFormThead = ['apple', 'banana']
export default {
data() {
data: function() {
return {
tableData: [
{

View file

@ -23,7 +23,7 @@
<script>
export default {
data() {
data: function() {
return {
tableData: [
{

View file

@ -69,7 +69,7 @@ export default {
return statusMap[status]
}
},
data() {
data: function() {
return {
list: null,
listLoading: true,

View file

@ -47,7 +47,7 @@ import treeToArray from './customEval'
export default {
name: 'CustomTreeTableDemo',
components: { treeTable },
data() {
data: function() {
return {
func: treeToArray,
expandAll: false,

View file

@ -20,7 +20,7 @@ import treeTable from '@/components/TreeTable'
export default {
name: 'TreeTableDemo',
components: { treeTable },
data() {
data: function() {
return {
columns: [
{

View file

@ -59,7 +59,7 @@ import '@/assets/custom-theme/index.css' // the theme changed version element-ui
export default {
name: 'Theme',
data() {
data: function() {
return {
theme: false,
tags: [

17
src/views/users/index.vue Normal file
View file

@ -0,0 +1,17 @@
<template>
<div class="users-container">
123
</div>
</template>
<script>
export default {
name: 'Users',
data: function() {
return {
users: []
}
}
}
</script>

View file

@ -39,7 +39,7 @@ import { fetchList } from '@/api/article'
export default {
name: 'ExportZip',
data() {
data: function() {
return {
list: null,
listLoading: true,