説明例
In this example, we generate a QR code from input text using a npm package and display the QR code in a vector image element.
どのように構築したか
ページ要素
On the HOME page, we added the following page elements:
TextInput: To enter the text to turn into a QR code.
Button: To start the QR code generation process.
VectorImage: To display the QR code that is generated.
コード
On the HOME page, we used code to handle button clicks by reading the input text, calling a backend function to turn the text into a QR code SVG XML, and display the QR code image.
We imported the qrcode npm package and use it in the backend.
In the backend qrCode.jsw file, we used code to import an npm package and create a function that takes in a text string and returns a QR code SVG XML string.
関連例
これは役に立ったか?
|
ご意見ありがとう!
カートに入れる ギャラリー
顧客に商品をカートに追加させる
中級
エレメントの非表示と表示
ユーザーのインタラクションに応じて要素を隠したり表示したりする
ビギナー
エレメントの非表示と表示
ユーザーのインタラクションに応じて要素を隠したり表示したりする
ビギナー