new Vue({ el: "#app", data: { key: "v;mr;3w'+eNC@;f6", str: "Sample", encode: true, }, computed: { output(){ let res = window.CryptoJS.AES[(this.encode ? 'encrypt' : 'decrypt')](this.str, this.key); if(!this.encode) return res.toString(CryptoJS.enc.Utf8); return res; } }, methods: {}, mounted() {} })