EasyUI Forum
April 29, 2024, 01:42:08 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: 'messager' component custom ok text does not work properly  (Read 4797 times)
fengdie
Jr. Member
**
Posts: 87


View Profile Email
« on: October 01, 2018, 09:03:31 PM »

Code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>EasyUI for Vue</title>
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/vue.css">
    <script src="http://www.jeasyui.com/node_modules/vx-easyui/vue.min.js"></script>
    <script src="http://www.jeasyui.com/node_modules/vx-easyui/babel-polyfill.js"></script>
    <script src="http://www.jeasyui.com/node_modules/vx-easyui/vx-easyui-min.js"></script>
    <script src="http://www.jeasyui.com/node_modules/vx-easyui/babel.min.js"></script>
    <style type="text/css">
        body{
            padding: 20px;
        }
        h2{
            margin: 0 0 20px 0;
        }
        .mycontainer{
            min-width: 700px;
        }
    </style>
</head>
<body>
        <div id="app"></div>
    <script type="text/babel">
        var demointeractive={
            template: `
  <div>
        <h2>Interactive Messager</h2>
        <LinkButton @click="confirm()">Confirm</LinkButton>
        <LinkButton @click="prompt()">Prompt</LinkButton>
  </div>
`,
           
  methods: {
    confirm() {
      this.$messager.confirm({
        title: "Confirm",
        msg: "Are you confirm this?",
        ok: '确定',
        cancel:'取消',
        result: r => {
          if (r) {
            alert("confirmed: " + r);
          }
        }
      });
    },
    prompt() {
      this.$messager.prompt({
        title: "Prompt",
        msg: "Please type something",
        result: r => {
          if (r) {
            alert("you type: " + r);
          }
        }
      });
    }
  }
        }
        var app = new Vue({
            el: '#app',
            template: `<demointeractive class="mycontainer"></demointeractive>`,
            components: {
                demointeractive:demointeractive         }
        })
    </script>
   

</body>
</html>


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 02, 2018, 08:39:19 AM »

Please call this code instead.
Code:
this.$messager.confirm({
  title: "Confirm",
  msg: "Are you confirm this?",
  buttons:[{
    text:'Ok',
    value:true
  },{
    text:'Cancel',
    value:false
  }],
  result: r => {
    if (r) {
      alert("confirmed: " + r);
    }
  }
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!