add component demo

This commit is contained in:
王劲鹏 2021-05-27 18:27:08 +08:00 committed by osborn
parent 19cc85cf1c
commit ad9b9054b0
3 changed files with 37 additions and 31 deletions

View File

@ -17,51 +17,54 @@ void DoricDemoBridge::navigate(QVariant route) {
QString name; QString name;
switch (route.toInt()) { switch (route.toInt()) {
case 0: case 0:
name = "Counter.js"; name = "ComponetDemo.js";
break; break;
case 1: case 1:
name = "EffectsDemo.js"; name = "Counter.js";
break; break;
case 2: case 2:
name = "Gobang.js"; name = "EffectsDemo.js";
break; break;
case 3: case 3:
name = "ImageDemo.js"; name = "Gobang.js";
break; break;
case 4: case 4:
name = "InputDemo.js"; name = "ImageDemo.js";
break; break;
case 5: case 5:
name = "LayoutDemo.js"; name = "InputDemo.js";
break; break;
case 6: case 6:
name = "LayoutTestDemo.js"; name = "LayoutDemo.js";
break; break;
case 7: case 7:
name = "ModalDemo.js"; name = "LayoutTestDemo.js";
break; break;
case 8: case 8:
name = "NetworkDemo.js"; name = "ModalDemo.js";
break; break;
case 9: case 9:
name = "PopoverDemo.js"; name = "NetworkDemo.js";
break; break;
case 10: case 10:
name = "ScrollerDemo.js"; name = "PopoverDemo.js";
break; break;
case 11: case 11:
name = "SimpleDemo.js"; name = "ScrollerDemo.js";
break; break;
case 12: case 12:
name = "Snake.js"; name = "SimpleDemo.js";
break; break;
case 13: case 13:
name = "StorageDemo.js"; name = "Snake.js";
break; break;
case 14: case 14:
name = "SwitchDemo.js"; name = "StorageDemo.js";
break; break;
case 15: case 15:
name = "SwitchDemo.js";
break;
case 16:
name = "TextDemo.js"; name = "TextDemo.js";
break; break;
} }

View File

@ -15,7 +15,7 @@ ApplicationWindow {
ListView { ListView {
width: parent.width width: parent.width
model: 16 model: 17
delegate: Rectangle { delegate: Rectangle {
Column { Column {
anchors.centerIn: parent anchors.centerIn: parent
@ -23,36 +23,38 @@ ApplicationWindow {
text: { text: {
switch (index) { switch (index) {
case 0: case 0:
return "Counter.js" return "ComponetDemo.js"
case 1: case 1:
return "EffectsDemo.js" return "Counter.js"
case 2: case 2:
return "Gobang.js" return "EffectsDemo.js"
case 3: case 3:
return "ImageDemo.js" return "Gobang.js"
case 4: case 4:
return "InputDemo.js" return "ImageDemo.js"
case 5: case 5:
return "LayoutDemo.js" return "InputDemo.js"
case 6: case 6:
return "LayoutTestDemo.js" return "LayoutDemo.js"
case 7: case 7:
return "ModalDemo.js" return "LayoutTestDemo.js"
case 8: case 8:
return "NetworkDemo.js" return "ModalDemo.js"
case 9: case 9:
return "PopoverDemo.js" return "NetworkDemo.js"
case 10: case 10:
return "ScrollerDemo.js" return "PopoverDemo.js"
case 11: case 11:
return "SimpleDemo.js" return "ScrollerDemo.js"
case 12: case 12:
return "Snake.js" return "SimpleDemo.js"
case 13: case 13:
return "StorageDemo.js" return "Snake.js"
case 14: case 14:
return "SwitchDemo.js" return "StorageDemo.js"
case 15: case 15:
return "SwitchDemo.js"
case 16:
return "TextDemo.js" return "TextDemo.js"
} }
} }

View File

@ -9,6 +9,7 @@
<file alias="assets_iconfont.ttf">./resources/assets_iconfont.ttf</file> <file alias="assets_iconfont.ttf">./resources/assets_iconfont.ttf</file>
</qresource> </qresource>
<qresource prefix="/doric/bundles"> <qresource prefix="/doric/bundles">
<file alias="ComponetDemo.js">../../../doric-demo/bundle/src/ComponetDemo.js</file>
<file alias="Counter.js">../../../doric-demo/bundle/src/Counter.js</file> <file alias="Counter.js">../../../doric-demo/bundle/src/Counter.js</file>
<file alias="EffectsDemo.js">../../../doric-demo/bundle/src/EffectsDemo.js</file> <file alias="EffectsDemo.js">../../../doric-demo/bundle/src/EffectsDemo.js</file>
<file alias="Gobang.js">../../../doric-demo/bundle/src/Gobang.js</file> <file alias="Gobang.js">../../../doric-demo/bundle/src/Gobang.js</file>