Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue #52 #274

Merged
merged 1 commit into from
Nov 26, 2018
Merged

fixed issue #52 #274

merged 1 commit into from
Nov 26, 2018

Conversation

issaTan
Copy link
Contributor

@issaTan issaTan commented Sep 29, 2018

fixed issue #52

Still have issue #52 .
I found the reason, here's the code.

   // backup the title chunk in case user wants access to it
    if (info.title) {
      info.titleChunk = info.title;
    }

    // replace title with populated template
    if (info.titleTemplate) {
      info.title = applyTemplate(component)(info.titleTemplate)(info.titleChunk);
    }
    ...
    var applyTemplate = function (component) { return function (template) { return function (chunk) { return typeof template === 'function' ? template.call(component, chunk) : template.replace(/%s/g, chunk); }; }; };

wx20180929-181139

At line 514, info.title === '' is true, so info.titleChunk is undefined, but info.titleTemplate === '%s | MySite' still true, so when template.replace(/%s/g, chunk), it will return undefined | MySite.

@codecov
Copy link

codecov bot commented Sep 29, 2018

Codecov Report

Merging #274 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #274   +/-   ##
======================================
  Coverage    40.3%   40.3%           
======================================
  Files          18      18           
  Lines         263     263           
======================================
  Hits          106     106           
  Misses        157     157
Impacted Files Coverage Δ
src/shared/getMetaInfo.js 94.64% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ac5d5b...dc877f0. Read the comment docs.

@atinux atinux merged commit f744bde into nuxt:master Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants