Skip to content

Commit 53fd0f0

Browse files
authored
Added prompt (#48)
* Added prompt * Update readme with prompt example * Build scripts * 1.4.0 * Update translation
1 parent 3aa9202 commit 53fd0f0

17 files changed

+667
-564
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
node_modules/

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,28 @@ okCallback: function (dialog) {
176176
}
177177
```
178178
179+
## Prompt (collect data from user)
180+
181+
```javascript
182+
this.$dialog
183+
.prompt({
184+
title: "Let's hear from you",
185+
body: "What is the most important thing in life?",
186+
promptHelp: 'Type in the box below and click "[+:okText]"'
187+
})
188+
.then(dialog => {
189+
// Triggered when proceed button is clicked
190+
// Show an alert with the user's input as the message
191+
this.$dialog.alert(dialog.data || '[empty]')
192+
})
193+
.catch(() => {
194+
// Triggered when dialog is dismissed by user
195+
196+
console.log('Prompt dismissed');
197+
});
198+
```
199+
200+
179201
## Usage with ajax - Loader enabled
180202
181203
```javascript

dist/vuejs-dialog-mixin.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuejs-dialog.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
ga('create', 'UA-105766420-1', 'auto');
1414
ga('send', 'pageview');
1515
</script>
16-
<link href="css/app.main.css?6674f9de4f06722b31c8" rel="stylesheet"></head>
16+
<link href="css/app.main.css?8bacb689809c4d1d370c" rel="stylesheet"></head>
1717
<body>
1818
<div id="app"></div>
1919
<script src="https://unpkg.com/vue@2.4.2/dist/vue.min.js"></script>
20-
<script type="text/javascript" src="js/app.main.js?6674f9de4f06722b31c8"></script></body>
20+
<script type="text/javascript" src="js/app.main.js?8bacb689809c4d1d370c"></script></body>
2121
</html>

docs/js/app.main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)