提交 36df19e7 编写于 作者: P Phil Hughes

Stop passing through the store object

[ci skip]
上级 14387b49
......@@ -59,6 +59,9 @@ export default {
elementType() {
return this.showForm ? 'form' : 'div';
},
formState() {
return this.store.formState;
},
},
components: {
descriptionComponent,
......@@ -142,7 +145,7 @@ export default {
<template>
<div :is="elementType">
<title-component
:store="store"
:form-state="formState"
:show-form="showForm"
:issuable-ref="issuableRef"
:title-html="state.titleHtml"
......
<script>
export default {
props: {
store: {
formState: {
type: Object,
required: true,
},
},
data() {
return {
state: this.store.formState,
};
},
};
</script>
......@@ -27,6 +22,6 @@
type="text"
placeholder="Issue title"
aria-label="Issue title"
v-model="state.title" />
v-model="formState.title" />
</fieldset>
</template>
......@@ -27,7 +27,7 @@
type: String,
required: true,
},
store: {
formState: {
type: Object,
required: true,
},
......@@ -56,7 +56,7 @@
<div>
<title-field
v-if="showForm"
:store="store" />
:form-state="formState" />
<h2
v-else
class="title"
......
......@@ -17,7 +17,7 @@ describe('Title field component', () => {
vm = new Component({
propsData: {
store,
formState: store.formState,
},
}).$mount();
});
......
......@@ -7,17 +7,18 @@ describe('Title component', () => {
beforeEach(() => {
const Component = Vue.extend(titleComponent);
const store = new Store({
titleHtml: '',
descriptionHtml: '',
issuableRef: '',
});
vm = new Component({
propsData: {
issuableRef: '#1',
titleHtml: 'Testing <img />',
titleText: 'Testing',
showForm: false,
store: new Store({
titleHtml: '',
descriptionHtml: '',
issuableRef: '',
}),
formState: store.formState,
},
}).$mount();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册