WXML
Add an activity title and a booking button to this mini program screen.
Add an activity title and a booking button to this mini program screen.
<view>
<text>{{title}}</text>
<button>Reserve this time</button>
</view>title: "Weekend pottery"Saturday 14:00 · Pottery workshop
{{title}} reads the activity name from page data. The button tag declares an object; separate logic handles its click.
Bind data, rather than duplicate the page: {{title}} displays a field from page data. List and condition directives control which objects appear as data changes.
Use the platform’s components: WeChat uses tags such as view, text, and button. WXML resembles HTML but is not a browser document.
Add an activity title and booking button to this WeChat page’s WXML. Bind the title to page data and connect the button to existing booking logic. Change the activity name afterward and verify the title updates while booking still works.