This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Computed properties are properties which are usually generated based on reactive data which are cached and only update when dependencies change. | |
| */ | |
| <template> | |
| <p>{{ data.number }}</p> | |
| <p>This number is {{ oddOrEven }}</p> | |
| <button @click="newNumber(5)">Set the number<button/> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <h1>{{ title }}</h1> | |
| <p>Edit title: </p> | |
| <input v-model="title" type="text"/> | |
| </template> | |
| <script setup> | |
| import { ref } from 'vue' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <p>{{ text }}</p> | |
| </template> | |
| <script setup> | |
| import { ref } from 'vue' | |
| const text = ref('juhu') | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('#saveNewTasklist').on("click", function () { | |
| const nestedQuery = '.nested-sortable'; | |
| const identifier = 'taskId'; | |
| const root = document.getElementById('tasks'); | |
| function serialize(tasks) { | |
| var serialized = []; | |
| var children = [].slice.call(tasks.children); // children == document property | |
| /** | |
| * [].slice.call() == Array.prototype.slice.call() | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var overviewPageUrl = '@Model.Content.Url'; | |
| var overviewPageUrl = '@Model.Content.Parent.Url'; | |
| var detailPageUrl = '@Model.Content.Children.SingleOrDefault(node => node.DocumentTypeAlias == "MDArticleLocalDetailPage").Url'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // place in template | |
| do_action( 'tuttner_show_payment_options' ); | |
| // place in functions.php | |
| add_action( 'tuttner_show_payment_options', 'woocommerce_checkout_payment', 20 ); | |
| // this example is for custom placing a payment options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $args = array( | |
| 'post_type' => 'product', | |
| 'product_cat' => 'klaviere', | |
| 'posts_per_page' => 3, | |
| 'orderby' => 'date', | |
| 'order' => 'DESC' | |
| ); | |
| $loop = new WP_Query($args); | |
| while ($loop->have_posts()) : $loop->the_post(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // model | |
| // ts | |
| export interface Post { | |
| // some data for example | |
| title: string; | |
| content: string; | |
| } | |
| // service | |
| // ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // html | |
| <textarea rows="6" [value]="newPost"></textarea> // property is element property written in [] | |
| <button (click)="methodName()">Btn text</button> | |
| // ts | |
| export class className { | |
| newPost='predefined text for textarea'; | |
| methodName() { | |
| // do something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // html | |
| <button (click)="methodName()">Btn text</button> | |
| <p>{{ newPost }}</p> | |
| // ts | |
| export class className { | |
| newPost=''; | |
| methodName() { | |
| this.newPost = 'some text'; |