Props & events có type
Props và events của mọi wrapper được generate từ Custom Elements Manifest chính thức của Shopify, nên bạn có autocomplete và type-check khớp với API thật của component.
Các component Vue 3 có type cho Polaris web components của Shopify (s-button, s-text-field, s-modal, ...), không cần học thêm một design system riêng cho Vue.
<STextField v-model="name" />
<SButton variant="primary">Save</SButton>Vue 3 wrapper cho Shopify Polaris
Trọn vẹn Polaris. Không phải học lại.
Props và events của mọi wrapper được generate từ Custom Elements Manifest chính thức của Shopify, nên bạn có autocomplete và type-check khớp với API thật của component.
Text field, checkbox, switch, select, choice list, date picker và nhiều component khác đều hỗ trợ v-model sẵn, được map đúng cặp prop/event bên dưới của từng element.
Prop lạ được truyền thẳng qua $attrs, nội dung slot được chuyển nguyên vẹn. Wrapper cũ không bao giờ làm hỏng code đang chạy, chỉ thiếu type cho tính năng mới.
Định nghĩa component và type được generate trực tiếp từ Custom Elements Manifest của Shopify, giữ cho wrapper luôn khớp với runtime Polaris trên CDN.
Polaris web components của Shopify (<s-button>, <s-text-field>, <s-modal>, …) chạy được với mọi framework, nhưng trong template Vue chúng chỉ là custom element không có type: không autocomplete, không kiểm tra prop, và không có v-model. polaris-vue-elements bọc từng element trong một Vue 3 component mỏng, được generate từ Custom Elements Manifest của Shopify, còn runtime Polaris vẫn được tải từ CDN của Shopify.
<script setup lang="ts">
import { ref } from 'vue'
import { SButton, STextField } from 'polaris-vue-elements'
const name = ref('')
</script>
<template>
<STextField v-model="name" label="Store name" />
<SButton variant="primary">Save</SButton>
</template>62 component. Một lần import.