| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <style>
- </style>
- <template id="com-header">
- <div class="com-header" flex="dir:left box:first cross:center">
- <span><slot></slot></span>
- <div flex="dir:right">
-
- <div>
- <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
- <input name="flag" type="hidden" value="EXPORT">
- <input v-for="(item,index) in search"
- :name="index"
- type="hidden"
- :value="item">
- <slot name="other"></slot>
- </div>
- <button @click="exportData()" class="el-button el-button--primary el-button--small">导出全部</button>
- </div>
- </div>
- </template>
- <script>
- Vue.component('com-header', {
- template: '#com-header',
- props: {
- url: {
- type: String,
- default: ''
- },
- newSearch: {
- type: String,
- default: '',
- }
- },
- watch: {
- newSearch: function (newVal) {
- let self = this;
- let newSearch = JSON.parse(newVal);
- self.search = newSearch;
- }
- },
- data() {
- return {
- search: [],
- }
- },
- methods: {
- exportData() {
- this.$emit('export-data');
- }
- }
- })
- </script>
|