Skip to content

QuickCorp/qcobjects-view-stack-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial: A View Stack Using QCObjects

Step 1:

Create three files: view-stack.html. one.html, two.html

Step 2:

Iside the file index.html include the following tag in the head section:

<head>
<script type="text/javascript" src="https://cdn.qcobjects.dev/QCObjects.js"></script>
</head>

Step 3:

In the body section, add the following:

<h1>This is a view stack example</h1>
<h2>There are 3 files, view-stack.html , one.html and two.html</h2>
<h3>This part of the page (index.html) does not change when you click in a link</h3>
<p>Open DevTools in your browser (second mouse button, click on  Inspect Elements) and see what happens with the elements of this page when you click a link</p>

<component name="view-stack">
  <routing path="#one" name="page-one"></routing>
  <routing path="#two" name="page-two"></routing>
  <routing path="#" name="view-stack"></routing>
  <routing path="" name="view-stack"></routing>
</component>

Step 4:

Give some style to your component

<style>
component[name=view-stack]{
  border: 1px solid black;
   width: 200px;
   height: 200px;
   position: relative;
   display: block;
   padding: 0;
}
</style>

The complete code looks like this

<head>
<script type="text/javascript" src="https://cdn.qcobjects.dev/QCObjects.js"></script>
</head>

<body>
<style>
component[name=view-stack]{
  border: 1px solid black;
   width: 200px;
   height: 200px;
   position: relative;
   display: block;
   padding: 0;
}
</style>
<h1>This is a view stack example</h1>
<h2>There are 3 files, view-stack.html , one.html and two.html</h2>
<h3>This part of the page (index.html) does not change when you click in a link</h3>
<p>Open DevTools in your browser (second mouse button, click on  Inspect Elements) and see what happens with the elements of this page when you click a link</p>
<component name="view-stack">
<routing path="#one" name="page-one"></routing>
<routing path="#two" name="page-two"></routing>
<routing path="#" name="view-stack"></routing>
<routing path="" name="view-stack"></routing>
</component>

</body>

See the file index.html for a complete example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages