Skip to content

베타

이 App Bridge 컴포넌트는 새로 추가되었으며 아직 실제 Shopify admin에서 테스트되지 않았습니다. 베타 기간에는 마이너 릴리스에서 API가 바뀔 수 있습니다. 문제가 있으면 issue를 등록해 주세요.

SaveBar ​

시작하기 전에 설치를 참고하고, open에 대해서는 Modal을 참고하세요.

SaveBar는 ui-save-bar를 렌더링합니다. ui-save-bar 타입에 설명되어 있듯이 "the button with variant primary is the Save button and the button without a variant is the Discard button"입니다.

vue
<script setup lang="ts">
import { ref } from 'vue'
import { SaveBar } from 'polaris-vue-elements/app-bridge'

const dirty = ref(false)

function save(): void {
  dirty.value = false
}
function discard(): void {
  dirty.value = false
}
</script>

<template>
  <SaveBar id="settings-save-bar" v-model:open="dirty" discard-confirmation>
    <button variant="primary" @click="save">Save</button>
    <button @click="discard">Discard</button>
  </SaveBar>
</template>

open, v-model:open, show/hide, 언마운트 시 숨김은 Modal과 같이 동작합니다. discardConfirmation("whether to show a confirmation dialog when the discard button is clicked")은 요소의 discardConfirmation 속성으로 설정됩니다.

폼의 경우, 임베디드 앱 가이드의 data-save-bar 속성은 컴포넌트가 필요 없습니다.

MIT 라이선스로 배포됩니다. Vue 로고: Evan You, CC BY-NC-SA 4.0.