Skip to content

Instantly share code, notes, and snippets.

oninit: function () {
// set default filter on init
var orderStatus = SSIurlModul.getKey('ORDST');
if (!orderStatus) {
SSIurlModul.set("ORDST", "15,17,20,21,30,31,35,40,41,42,43");
};
},
oncomplete: function () {
// re-init filter to set default values
SSI.portal.init();
// https://ractive.js.org/api/#class-42
<div class-foo="isFoo">Adds "foo" if isFoo is truthy</div>
/* for example get el width */
// template
<p ref="appTitleRef">App title</p>
// script
const appTitleRef = ref(null)
onMounted(() => {
console.log(`The app title is ${ appTitleRef.value.offsetWidth } px wide`)
// script
const posts = ref([
{
id: 1,
title: 'post 1'
},
{
id: 2,
title: 'post 2'
}
/*
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>
<template>
<h1>{{ title }}</h1>
<p>Edit title: </p>
<input v-model="title" type="text"/>
</template>
<script setup>
import { ref } from 'vue'
@ABooooo
ABooooo / Refs
Last active June 19, 2024 11:46
<template>
<p>{{ text }}</p>
</template>
<script setup>
import { ref } from 'vue'
const text = ref('juhu')
</script>
$('#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()
*
var overviewPageUrl = '@Model.Content.Url';
var overviewPageUrl = '@Model.Content.Parent.Url';
var detailPageUrl = '@Model.Content.Children.SingleOrDefault(node => node.DocumentTypeAlias == "MDArticleLocalDetailPage").Url';
// 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