Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form按钮显示table多选更改 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions src/components/app-form/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</el-form>
<div class="form-footer" slot="footer">
<slot name="button" />
<el-button type="primary" v-if="showButton" @click="cancelHandler">取消</el-button>
<el-button type="primary" v-if="showButton" @click="submitHandler" :loading="loading">提交</el-button>
<el-button type="primary" v-if="showCancelBtn.btnShow" @click="cancelHandler">{{showCancelBtn.btnText}}</el-button>
<el-button type="primary" v-if="showSubmitBtn.btnShow" @click="submitHandler" :loading="loading">{{showSubmitBtn.btnText}}</el-button>
</div>
</el-dialog>
</template>
Expand Down Expand Up @@ -74,23 +74,37 @@ export default {
return 'form' + Date.now();
}
},
/**
* 是否显示操按钮
/**
* 是否显示操按
*/
showButton: {
type: Boolean,
showSubmitBtn:{
type: Object,
required: false,
default() {
return true
return {
btnShow:true,
btnText:"提交"
}
}
}
},
showCancelBtn:{
type: Object,
required: false,
default() {
return {
btnShow:true,
btnText:"取消"
}
}
},
},
data() {
return {
// rules: [],
loading: false
}
},

computed: {
query: {
set(params) {
Expand Down Expand Up @@ -122,7 +136,8 @@ export default {
return rules;
},
showForm: {
get() {
get() {
console.log(1)
return this.show;
},
set(val) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/app-table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
style="width: 100%;margin-top: 9px"
v-loading="loading"
ref="table"
@select="selectionChange"
@selection-change="selectionChange"
>
<el-table-column
v-if="selected"
Expand Down