#Vue.js component for Select2
A select2 component for vue.js. Quickly create select2 components, load data via ajax and retrieve selected values and newly created tags.
#Usage
Download and register the component:
Vue.component(
| // JS File -- index.js | |
| Vue.component( 'test-com', { | |
| template: 'tmpl-test-com', | |
| data: function() { | |
| return { | |
| localizeData: [] | |
| } |
#Vue.js component for Select2
A select2 component for vue.js. Quickly create select2 components, load data via ajax and retrieve selected values and newly created tags.
#Usage
Download and register the component:
Vue.component(
| /* Woocommerce Styles */ | |
| /* | |
| A couple things to note... | |
| 1. This code was written very specifically for my base child theme so it might not work out of the box with every theme. | |
| I have it here mostly to share with anyone who might be looking to do the same thing I was. | |
| 2. I generally add my WooCommerce CSS overrides to a custom-woo.css file then use wp_enqueue_style() to call it | |
| so that it enqueues after the default WooCommerce Stylesheets |
| <template> | |
| <div class="wpvue-modal-dialog"> | |
| <div class="wpvue-modal"> | |
| <div class="wpvue-modal-content" :style="{ width: width }"> | |
| <section :class="['wpvue-modal-main', { 'has-footer': footer }]"> | |
| <header class="modal-header" v-if="header"> | |
| <slot name="header"> | |
| <h1>{{ title }}</h1> | |
| </slot> | |
| </header> |
| ➜ vvv-local git:(stable) vagrant reload --provision | |
| __ __ __ __ | |
| \ V\ V\ V / v3.8.1 Path:"/Users/sabbir/vvv-local" | |
| \_/\_/\_/ git::stable(8252690) | |
| Platform: darwin19 shell:/bin/zsh vagrant-goodhosts shared_db_folder_disabled | |
| Vagrant: v2.2.19, virtualbox: v6.1.32 | |
| Docs: https://varyingvagrantvagrants.org/ | |
| Contribute: https://github.com/varying-vagrant-vagrants/vvv |
| $input_lines = '<a href="index.php" target="_blank" class="link testing" >Test Link</a><a href="index.php" class="link testing" target="_blank" >Test Link</a><a href="index.php" target="_blank" class="link testing" >Test Link</a>'; | |
| $replace_text = preg_replace('/(\<a.*?target=\"_blank\".*?>)(.*?)(\<\/a\>)/', '$1$2<span>screen reader</span>$3', $input_lines); | |
| echo $replace_text; | |
| // Output... | |
| <a href="index.php" target="_blank" class="link testing" >Test Link<span>screen reader</span></a> | |
| <a href="index.php" class="link testing" target="_blank" >Test Link<span>screen reader</span></a> |