部分组件不再需要传递id
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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']
|
||||
});
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
import getCookie from "../../utils/cookie"
|
||||
|
||||
export default ({
|
||||
props: {
|
||||
uploaderId: {
|
||||
required: true,
|
||||
data() {
|
||||
return {
|
||||
uploaderId: Math.random().toString(36).substr(2)
|
||||
}
|
||||
},
|
||||
props: {
|
||||
uploadPath: {
|
||||
required: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user