var app = new Vue({ el: '#app', data() { return { notice:[], popnotice:[{ subject:'', content:'' }], isshow:false } }, computed: { }, beforeCreate() {}, created() { this.read(); this.popup(); }, beforeMount(){}, mounted(){ this.$nextTick(function(){ this.isshow = true; }) }, beforeUpdate() {}, updated(){}, beforeDestory() {}, destroyed() {}, methods: { viewNotice: function(seq_no){ location.href = '/notice/view/'+seq_no; }, popup: async function() { var _process = await axios.get('/api/noticepopup') .then(res =>{ let _data = res.data; this.popnotice = _data.data; if(_data.status) { return true; } else { return false; } }) .catch(function(error){ console.log(error); return false; }); if(_process){ $('.modal-dialog').draggable({ handle: ".modal-header" }); $('.popup-modal').show(); } }, read() { axios.get('/api/noticelist') .then(res =>{ let _data = res.data; this.notice = _data.data; this.isshow = true; }) .catch(function(error){ console.log(error); }); } } }); $(function() { $('#app').on('click', '.close-modal-btn', function(){ var _this = $(this); _this.closest('.modal-content').children('.modal-body').html(''); _this.closest('.modal-content').find('.modal-title').text(''); _this.closest('.popup-modal').hide(); }); $('.modal-dialog').draggable({ handle: ".modal-header" }); });