基于Webpack为您的应用打包的机制,在某些情况下,您可能需要使用QItemTile,比如头像或图片。原因很简单:如果你使用QItemSide的avatar属性,你必须提供静态文件夹的路径,不能使用assets文件夹或相对路径。相反,后两者可以与包装一个<img>HTML标签的QItemTile一起使用。仔细看上面例子中的图像路径(statics/guy-avatar.png vs ~assets/boy-avatar.png)。另请阅读应用静态资源处理 以了解Webpack如何将资源包含到软件包中。
<!-- 我们希望点击/轻按整个QItem 以切换复选框,所以我们使用tag="label" 以<label>标签渲染QItem。 --> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checkboxModel" /> </q-item-side> <q-item-main> <q-item-tilelabel>Notifications</q-item-tile> <q-item-tilesublabel>Notify me about updates to apps or games that I downloaded</q-item-tile> </q-item-main> </q-item>
<q-listhighlightinset-separator> <q-item> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-mainlabel="Brunch this weekend? Brunch this weekend? Brunch this weekend?"label-lines="1" /> <q-item-siderightstamp="1 min" /> </q-item> <q-itemmultiline> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-main label="Brunch this weekend? Brunch this weekend? Brunch this weekend?" label-lines="1" sublabel="John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe" sublabel-lines="2" /> <q-item-sideright> <q-item-tilestamp>1 week ago</q-item-tile> </q-item-side> </q-item> <q-itemmultiline> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-main label="Brunch this weekend? Brunch this weekend? Brunch this weekend?" label-lines="2" sublabel="John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe" /> <q-item-siderightstamp="10 min" /> </q-item> <q-itemmultiline> <q-item-side> <q-item-tileavatar> <imgsrc="statics/boy-avatar.png"> </q-item-tile> </q-item-side> <q-item-main> <q-item-tilelabel>Brunch <span>5</span></q-item-tile> <q-item-tilesublabellines="2"> John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe John Doe </q-item-tile> </q-item-main> <q-item-sideright> <q-item-tilestamp>10 min</q-item-tile> <q-item-tileicon="star"color="yellow" /> </q-item-side> </q-item> <q-itemmultiline> <q-item-sideavatar="statics/boy-avatar.png" /> <q-item-main> <q-item-tilelabellines="1">Brunch this weekend? Yeah, this weekend. Really. This one.</q-item-tile> <q-item-tilesublabellines="2"> <span>John Doe</span> -- I'll be in your neighborhood doing errands this weekend. Do you want to grab brunch? </q-item-tile> </q-item-main> <q-item-sideright> <q-item-tilestamp>2 years</q-item-tile> <q-item-tileicon="mail"color="primary" /> </q-item-side> </q-item> </q-list>
<q-listlink> <q-list-header>User controls</q-list-header> <q-item> <q-item-main> <q-item-tilelabel>Content filtering</q-item-tile> <q-item-tilesublabel>Set the content filtering level to restrict apps that can be downloaded</q-item-tile> </q-item-main> </q-item> <q-item> <q-item-main> <q-item-tilelabel>Password</q-item-tile> <q-item-tilesublabel>Require password for purchase or use password to restrict purchase</q-item-tile> </q-item-main> </q-item> <q-item-separator /> <q-list-header>General</q-list-header> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checked_one" /> </q-item-side> <q-item-main> <q-item-tilelabel>Notifications</q-item-tile> <q-item-tilesublabel>Notify me about updates to apps or games that I downloaded</q-item-tile> </q-item-main> </q-item> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checked_two"color="secondary" /> </q-item-side> <q-item-main> <q-item-tilelabel>Sound</q-item-tile> <q-item-tilesublabel>Auto-update apps at anytime. Data charges may apply</q-item-tile> </q-item-main> </q-item> <q-itemtag="label"> <q-item-side> <q-checkboxv-model="checked_three"color="red" /> </q-item-side> <q-item-main> <q-item-tilelabel>Auto-add widgets</q-item-tile> <q-item-tilesublabel>Automatically add home screen widgets</q-item-tile> </q-item-main> </q-item> </q-list>
<q-listclass="q-mt-md"> <q-list-header>Radios</q-list-header> <q-itemlinktag="label"> <q-item-side> <q-radiov-model="option"val="opt1" /> </q-item-side> <q-item-mainlabel="Option 1" /> </q-item> <q-itemlinktag="label"> <q-item-side> <q-radiocolor="secondary"v-model="option"val="opt2" /> </q-item-side> <q-item-main> <q-item-tilelabel>Option 2</q-item-tile> <q-item-tilesublabel>Allows notifications</q-item-tile> </q-item-main> </q-item> <q-itemlinktag="label"> <q-item-side> <q-radiocolor="amber"v-model="option"val="opt3" /> </q-item-side> <q-item-main> <q-item-tilelabel>Option 3</q-item-tile> <q-item-tilesublabellines="3">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</q-item-tile> </q-item-main> </q-item>
<q-item-separator />
<q-list-header>Toggles</q-list-header> <q-itemlinktag="label"> <q-item-mainlabel="Events and reminders" /> <q-item-sideright> <q-togglev-model="checked_one" /> </q-item-side> </q-item> <q-itemlinktag="label"multiline> <q-item-main> <q-item-tilelabel>Events and reminders</q-item-tile> <q-item-tilesublabel>Lorem ipsum</q-item-tile> </q-item-main> <q-item-sideright> <q-togglev-model="checked_two"color="secondary" /> </q-item-side> </q-item> <q-itemlinktag="label"multiline> <q-item-main> <q-item-tilelabel>Events and reminders</q-item-tile> <q-item-tilesublabellines="3"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute </q-item-tile> </q-item-main> <q-item-sideright> <q-togglev-model="checked_three"color="amber" /> </q-item-side> </q-item>
<q-list-header>Movies</q-list-header> <q-itemmultiline> <q-item-sideimage="statics/parallax1.jpg" /> <q-item-main> <q-item-tilelabel>Must-see places</q-item-tile> <q-item-tilesublabellines="3"> The world in which we live is full of wonderful places that most of us do not know they really exist. Here you can see some of those breathtaking places around the world. Enjoy! </q-item-tile> </q-item-main> <q-item-siderighticon="movie" /> </q-item> <q-itemmultiline> <q-item-sideimage="statics/parallax2.jpg" /> <q-item-main> <q-item-tilelabel>Building a Bridge</q-item-tile> <q-item-tilesublabellines="5"> A bridge is one of those things that are often taken for granted until you don’t have one, especially if you live on a rural property and there’s a creek between your house and the county road. John Doe had plans to build a new bridge along with building a new house on his property, but plans for the bridge were made top priority when a wayward truck carried too much weight over the old bridge and it collapsed. </q-item-tile> </q-item-main> <q-item-siderighticon="movie" /> </q-item> </q-list>