index.vue 796 字节
Newer Older
1 2 3 4 5 6
<template>
    <div class="container w-auto m-auto bg-gray-200 mb-10">
        
        <div class="p-4">
            
            <span>添加内容</span>
7 8
            <textarea class="block my-2 w-full" :value="newContent"></textarea>
            <button class="bg-gray-300 py-2  px-4 rounded hover:bg-gray-400" @click="add"> add</button>
9 10 11 12 13 14 15 16
        </div>
    </div>
    
</template>
<script>
import Config from '../../js/config'
import RepEs from '../../js/repEs'

17
const esClient = new RepEs(Config.getData().data.ext)
18 19 20 21 22 23
export default {
    name: 'contentIndex',
    components: {
    },
    data() {
        return {
24
            newContent: '测试内容'
25 26 27 28
        }
    },
    methods: {
        add () {
29 30
            debugger
            esClient.add(this.newContent)
31 32 33 34
        }
    }
}
</script>