# snt-app
This service works in conjunction with Lodash (opens new window) and VueRouter (opens new window)
# Slot
The default Vue slot.
{
_: Lodash,
router: VueRouter,
route: {
path: string
name?: string | null
hash: string
query: Dictionary<string | (string | null)[]>
params: Dictionary<string>
fullPath: string
redirectedFrom?: string
meta?: any
},
// สีของ website ที่ลูกค้าตั้งค่าเองได้
theme: {
primary: string,
secondary: string,
accent: string
},
breakpoint: {
// Breakpoints
xs: boolean
sm: boolean
md: boolean
lg: boolean
xl: boolean
// Conditionals
xsOnly: boolean
smOnly: boolean
smAndDown: boolean
smAndUp: boolean
mdOnly: boolean
mdAndDown: boolean
mdAndUp: boolean
lgOnly: boolean
lgAndDown: boolean
lgAndUp: boolean
xlOnly: boolean
// true if screen width < mobileBreakpoint
mobile: boolean
mobileBreakpoint: number
// Current breakpoint name (e.g. 'md')
name: string
// Dimensions
height: number
width: number
// Thresholds
// Configurable through options
thresholds: {
xs: number
sm: number
md: number
lg: number
}
// Scrollbar
scrollBarWidth: number
},
// Notify
notification: {
success: (message: string) => void,
error: (message: string) => void,
info: (message: string) => void,
warning: (message: string) => void,
clear: () => void
},
// อุปกรณ์ที่ใช้เป็นมือถือหรือไม่
isMobileDevice: boolean,
// ตำแหน่งของ scroll
scrollUp: number,
scrollY: number ,
goTo: (selector: string) => void,
// Auth
auth: {
login(username: string, password: string): boolean
},
// สถานะ logged in ของลูกค้า
isAuth: boolean,
// ข้อมูล logged in ของลูกค้า
customer: {
id: ID,
name: string,
addressList: string[],
address: string,
tel: string,
postcode: string,
taxId: string,
email: string
},
// เพิ่มสินค้าในตะกร้า
addToCart: (item: {
id: ID,
name: string,
pictureUrl: string,
price: number,
available: number,
isCollection: boolean,
quantity: number
}) => void,
// จำนวนสินค้าในตะกร้า
purchasesQuantity: number,
// หมวดหมู่สินค้าทั้งหมดของร้าน
productCategories: Array<{
id: ID,
name: string
}>,
// แบรนด์สินค้าทั้งหมดของร้าน
productBrands: Array<{
id: ID,
name: string
}>,
// สถานะการโหลดข้อมูลเริ่มต้น
loading: boolean
}