Skip to content

Instantly share code, notes, and snippets.

View DanielPaulWilkinson's full-sized avatar
🏠
Working from home

Daniel Wilkinson DanielPaulWilkinson

🏠
Working from home
View GitHub Profile
<script setup lang="ts">
import { useSlots } from 'vue';
const props = withDefaults(defineProps<{
id: string;
visible: boolean;
title?: string | undefined;
cross?: boolean;
header: string;
}>(), {
title: undefined,
dialog {
border-radius: 20px;
background-color: #876;
color: #FFF;
padding: 0;
border: solid 1px #000;
min-width: 400px;
position: fixed;
.dialog-header {
<script setup lang="ts">
import { onMounted, reactive, watch } from "vue";
import Input from "./Input.vue";
type State = {
isOpen: boolean;
setResult: boolean;
searchTerm: string;
}
<script setup lang="ts">
const props = withDefaults(defineProps<{
id: string,
// https://www.w3schools.com/html/html_form_input_types.asp
type: "text" | "email" | "number" | "currency" | "tel",
modelValue: string | number | null,
// https://www.w3schools.com/tags/att_inputmode.asp
inputmode?: "numeric" | "text" | undefined,
placeholder?: string | null,
class?: string | null,
<script setup lang="ts">
import { onMounted, reactive, watch } from 'vue';
const props = withDefaults(defineProps<{
id: string,
starCount?: number,
readonly?: boolean
modelValue: number,
}>(), {
starCount: 5,
public class Cat : Animal
{
public Cat(string Name, int NumberOfLegs) : base(Name, NumberOfLegs) { }
public override void AnimalInformation()
{
Console.WriteLine($"-----------------------");
Console.WriteLine($"Cat Name: {Name}");
Console.WriteLine($"Number Of Legs: {NumberOfLegs}");
}
public abstract class Animal
{
private int _numberOfLegs = 0;
public int NumberOfLegs
{
get { return _numberOfLegs; }
set { _numberOfLegs = value; }
}
private string _name { get; set; } = "Animal";
public class Program
{
static void Main(string[] args)
{
Animal cat = new Cat("Jeff the cat",4);
cat.AnimalInformation();
Animal horse = new Horse("Barney the horse",4);
horse.AnimalInformation();
public class Animal
{
private int _numberOfLegs = 0;
public int NumberOfLegs
{
get { return _numberOfLegs; }
set { _numberOfLegs = value; }
}
private string _name { get; set; } = "Animal";
public int NumberOfLegs { get; set; } = 0;