部分组件不再需要传递id

This commit is contained in:
LiYang
2016-08-14 16:23:55 +08:00
parent b05d4cbac2
commit 59b0aadbf9
3 changed files with 10 additions and 13 deletions

View File

@@ -35,8 +35,7 @@
</tr>
</table>
<div class="form-group">
<uploader uploader-id="testCaseUploader"
upload-path="/"
<uploader upload-path="/"
:accept="{title: 'testcase zip', extensions: 'zip', mimeTypes: 'application/zip'}"
:upload-success="uploadSuccess"
:upload-error="uploadError"

View File

@@ -1,5 +1,5 @@
<template>
<textarea id="{{ editorid }}"></textarea>
<textarea id="{{ editorId }}"></textarea>
</template>
<script>
import Simditor from 'simditor'
@@ -8,12 +8,8 @@
export default{
data() {
return {
editor: {}
}
},
props: {
editorid: {
required: true
editor: {},
editorId: Math.random().toString(36).substr(2)
}
},
methods: {
@@ -27,7 +23,7 @@
attached() {
var self = this;
self.editor = new Simditor({
textarea: document.getElementById(self.editorid),
textarea: document.getElementById(self.editorId),
upload: {url: "/", fileKey: "file"},
toolbar: ['bold', 'italic', 'underline', 'color', 'image', 'ol', 'ul', 'markdown']
});

View File

@@ -12,10 +12,12 @@
import getCookie from "../../utils/cookie"
export default ({
data() {
return {
uploaderId: Math.random().toString(36).substr(2)
}
},
props: {
uploaderId: {
required: true,
},
uploadPath: {
required: true,
},