Skip to content

Commit

Permalink
add umd usage example index.html with the latest version of vue-ctk-d…
Browse files Browse the repository at this point in the history
…ate-time-picker
  • Loading branch information
YordanGeorgiev authored and Yordan Georgiev committed May 27, 2020
1 parent 7ee4c2a commit a54a5dd
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 7 deletions.
69 changes: 69 additions & 0 deletions docs/examples/umd/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!-- also @https://codepen.io/yordangeorgiev/pen/xxwNeJL -->
<html>
<head> <title>vue-ctk-date-time-picker-02</title>

<style>
html, body {
overflow-x: hidden;
max-width: 100%;
font-family: Helvetica Neue, Arial, sansserif;
height: 1000px;
}
</style>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/vue-ctk-date-time-picker@2.4.0/dist/vue-ctk-date-time-picker.css">
</head>

<body>
<script src="https://unpkg.com/vue" charset="utf-8"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-ctk-date-time-picker@2.4.0/dist/vue-ctk-date-time-picker.umd.min.js" charset="utf-8"></script>
<div id="app" style="fontsize: 7em">
<vue-ctk-date-time-pic :label="start_time" id="start_time_control" :value="time"> </vue-ctk-date-time-pic>
<vue-ctk-date-time-pic :label="stop_time" id="stop_time_control" :value="time"> </vue-ctk-date-time-pic>
</div>

<script type="text/x-template" id="vue-ctk-date-time-picker-tpl">
<vue-ctk-date-time-picker :format="'YYYY-MM-DD hh:mm'" :formatted="'YYYY-MM-DD hh:mm'" :label="'Select date'"
v-model="value" :first-day-of-week="1" :no-weekends-days="false">
</vue-ctk-date-time-picker>
</script>

<script>
var valVueDtPick = Vue.component('vue-ctk-date-time-pic', {
template: "#vue-ctk-date-time-picker-tpl"
, data: function () {
return {
value: null
}
},
methods: {
log: function (val) {
console.log(val)
}
},
components: { 'datetime-picker': Vue.component('vue-ctk-date-time-picker', window['vue-ctk-date-time-picker'])}
})

new Vue({
el: "#app"
, data: function () {
return {
time: null
}
},
components: { 'vue-ctk-date-time-pic': valVueDtPick}
})
</script>



<div>
<p> this page demonstrates the following : </p>
<pre>
- umd usage of vue-ctk-date-time-picker from CDN - https://www.jsdelivr.com/package/npm/vue-ctk-date-time-picker?path=dist
- iso-8601 :formatted="'YYYY-MM-DD HH:mm'" for the string in the inputs
- use monday as the first day of the week
- :no-weekends-days="false" - can be set to true and the user cannot select the days
- extend the vue-ctk-date-time-picker via custom template
</pre>
</body>
</html>
28 changes: 21 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a54a5dd

Please sign in to comment.